staticcode's avatar

Unable to upload BMP

Hi guys,

I am trying to upload pictures, which is going fine except for BMP files. I start my check with isValid() on the uploaded image(s). This returns an error.

When I remove the "check" it goes to the Laravel's storeAs() function which then returns the below error:

File not found Exception. MimeTypeGuesser.php 121

It is almost as if Laravel does not allow BMP / WBMP files te be uploaded.

In my case, I need to be able to upload the following extensions:

JPG, JPEG, PNG, BMP, WBMP, GIF

Basicly everything works fine except when uploading a BMP file. Hope someone can give me some more information on how to deal with this issue.

Best regards

if($request->file('attachment_file')->isValid()){

} else {

    return response()->json([

        'success' => false,
        'Exception' => 'Laravel returns invalid file'

    ]);

}
0 likes
3 replies
lostdreamer_nl's avatar

the bmp file is probably to big to upload (php's upload_max_filesize & post_max_size settings).

If so, the file will not be available and thus will be invalid.

staticcode's avatar

We editted the server to accept files up to 10mb of size :) The BMP we are trying are either 1mb or 3mb in size.

lostdreamer_nl's avatar

if you do dd($request->file('attachment_file'));

Do you see the file there (as an UploadedFile object)

Please or to participate in this conversation.