Search code examples
phplaravelfile-uploadmime-typeslaravel-medialibrary

Problem with uploading Image with bigger size (Application/octet-stream) - Laravel Media Library


I'm using Laravel Media Library by Spatie. Works perfectly on Local Machine, but whenever I try to upload an Image with size more than 2MB, it gives me the following error:

Spatie \ MediaLibrary \ Exceptions \ FileCannotBeAdded \ FileDoesNotExist
File `/` does not exist

I've already done the dd() and image comes with mime-type: Application/octet-stream

Whenever the image is with the above mime-type, the error occurs.

PS: I've already checked the similar questions on stackoverflow and already updated the upload_max_filesize, but did not work.

Any help will be highly appreciated.


Solution

  • Please check config/medialibrary.php

    'max_file_size' => 1024 * 1024 * 10 // For 10MB