troubleshooting Question

What is "SplFileInfo::getSize(): stat failed for C:\wamp64\tmp\phpA213.tmp?"

Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on
PHPLaravel
9 Comments1 Solution325 ViewsLast Modified:
Here's my code:

public function store(VideoRequest $request)
    {
        //
		$validated = $request->validated();
		$movie = new Video;
		
		if($request->hasFile('thumbnail')) {
			$file = $request->file('thumbnail');
			$thumbnail = $file->getClientOriginalName();
			$movie->thumbnail=$thumbnail;
			$file->move('assets/img', $thumbnail);
		}
			
		$movie->title=$validated['title'];
		$movie->description=$validated['description'];
		$movie->filename=$validated['filename'];
		$success='Video was successfully created!';
		
		if($movie->save()) {
			return View::make('/admin/displayVideo')
			->with('film', $movie)
			->with('newVideo', 'Here\'s the video you just created!');
		}
    }

It works!

All of the text, filenames etc are uploaded to the database and the thumbnail is accurately loaded into the appropriate directory..

But...

I get this error:

SplFileInfo::getSize(): stat failed for C:\wamp64\tmp\phpA213.tmp
(1/1) RuntimeException
SplFileInfo::getSize(): stat failed for C:\wamp64\tmp\phpA213.tmp

in RequestContext.php line 52
at SplFileInfo->getSize()
in RequestContext.php line 52
at RequestContext->Facade\FlareClient\Context\{closure}(object(UploadedFile))
at array_map(object(Closure), array('thumbnail' => object(UploadedFile)))
in RequestContext.php line 41
at RequestContext->mapFiles(array('thumbnail' => object(UploadedFile)))
in RequestContext.php line 36
at RequestContext->getFiles()
in RequestContext.php line 95
at RequestContext->getRequestData()
in RequestContext.php line 103
at RequestContext->toArray()
in LaravelRequestContext.php line 64
at LaravelRequestContext->toArray()
in Report.php line 211
at Report->allContext()
in AnonymizeIp.php line 11
at AnonymizeIp->handle(object(Report), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Report))
in AddGlows.php line 24
at AddGlows->handle(object(Report), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Report))
in Pipeline.php line 105
at Pipeline->then(object(Closure))
in Flare.php line 203
at Flare->applyMiddlewareToReport(object(Report))
in Flare.php line 179
at Flare->createReport(object(ViewException))
in ErrorPageHandler.php line 39
at ErrorPageHandler->handle(object(ViewException))
in IgnitionWhoopsHandler.php line 25
at IgnitionWhoopsHandler->handle(object(ViewException))
in Run.php line 321
at Run->handleException(object(ViewException))
in Handler.php line 345
at Handler->renderExceptionWithWhoops(object(ViewException))
in Handler.php line 324
at Handler->renderExceptionContent(object(ViewException))
in Handler.php line 308
at Handler->convertExceptionToResponse(object(ViewException))
in Handler.php line 287
at Handler->prepareResponse(object(Request), object(ViewException))
in Handler.php line 192
at Handler->render(object(Request), object(ViewException))
in Handler.php line 49
at Handler->render(object(Request), object(ViewException))
in Pipeline.php line 51
at Pipeline->handleException(object(Request), object(ViewException))
in Pipeline.php line 132
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in CheckRole.php line 23
at CheckRole->handle(object(Request), object(Closure), ' admin')
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in VerifyCsrfToken.php line 76
at VerifyCsrfToken->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in StartSession.php line 56
at StartSession->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in EncryptCookies.php line 66
at EncryptCookies->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 105
at Pipeline->then(object(Closure))
in Router.php line 682
at Router->runRouteWithinStack(object(Route), object(Request))
in Router.php line 657
at Router->runRoute(object(Request), object(Route))
in Router.php line 623
at Router->dispatchToRoute(object(Request))
in Router.php line 612
at Router->dispatch(object(Request))
in Kernel.php line 176
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
in Pipeline.php line 130
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in TransformsRequest.php line 21
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in TransformsRequest.php line 21
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in CheckForMaintenanceMode.php line 62
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in TrustProxies.php line 57
at TrustProxies->handle(object(Request), object(Closure))
in Pipeline.php line 171
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 105
at Pipeline->then(object(Closure))
in Kernel.php line 151
at Kernel->sendRequestThroughRouter(object(Request))
in Kernel.php line 116
at Kernel->handle(object(Request))
in index.php line 55

If I refresh the page, the error goes away and I get an alert that that the filenam is already taken. And that's because everything was added and uploaded correctly..

So why am I getting this error?

Here's my Request file:

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class VideoRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
			'title' => 'required', 
			'filename' =>'required | unique:videos',
			'description' => 'required'
        ];
    }
	
	public function messages()
    {
        return [
            'title is.required' => 'title is required!',
            'filename is.required' => 'don\'t forget to include your video file!',
			'descirption is.required' => 'be sure to include the description'
        ];
    }
}

What do yo uthink?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros