ajck's avatar
Level 1

Fatal error in MimeTypeGuesser.php for larger file uploads? (L 5.4)

My web app does a standard file upload from the user's browser to the server, user picks file using standard file selection dialog (e.g. Windows 7), and file uploaded via AJAX. Works fine for smaller files (e.g. few hundred K) but fails for larger ones (e.g. 2 to 3 MB or less). Route is:

Route::post('imgupload', ['middleware' => 'auth', 'uses' => 'FilmmakerController@imgupload']);

Then in the controller:

    public function imgupload(Request $request)
        {
        $imgpath = $request->file('imgfile')->store('public'); // Store images locally
        
        ...etc...

error page:

(1/1) FileNotFoundException
The file "" does not exist
in MimeTypeGuesser.php (line 123)
at MimeTypeGuesser->guess('')
in File.php (line 79)
at File->getMimeType()
in File.php (line 58)
at File->guessExtension()
in FileHelpers.php (line 60)
at UploadedFile->hashName()
in UploadedFile.php (line 34)
at UploadedFile->store('public')
in FilmmakerController.php (line 177) [note: 177 is the above $imgpath=... line]
at FilmmakerController->imgupload(object(Request))

Any thoughts?

Thanks.

0 likes
1 reply
jlucia's avatar

Could it be related to your PHP ini file settings? What is your value for post_max_size and upload_max_filesize?

Please or to participate in this conversation.