We help IT Professionals succeed at work.
Get Started

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

Bruce Gust
Bruce Gust asked
on
246 Views
Last Modified: 2020-02-29
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!');
		}
    }

Open in new window


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

Open in new window


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'
        ];
    }
}

Open in new window


What do yo uthink?
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2018
Distinguished Expert 2019
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE