What errors are you getting.
Edit:
Also what is the network tab showing.
How can I upload a file over 10 mb in my Laravel script, all upload size settings on my server are over 100 mb, but I cannot upload over 10 mb.
I would be glad if you help.
What errors are you getting.
Edit:
Also what is the network tab showing.
Upload limits can be set in many places, can you be more specific on what kind of error you get?
upload_max_filesize and post_max_size, verify if you set it correctly by dumping the values: dd(ini_get('upload_max_filesize'), ini_get('post_max_size'))
client_max_body_size: https://linuxhint.com/what-is-client-max-body-size-nginx/And of course, after making changes to php and/or nginx restart the services so your changes take effect.
@thekoswog You can’t upload files that are larger than a few megabytes in size in one go, because you’ll either hit a memory limit or a timeout limit, no matter what you change your php.ini or server settings to be. There’s just no way to let a browser way an infinite amount of time, or read a file into more RAM that’s available.
Instead, you’ll need to upload the file into “chunks” from the browser, and then assemble the file server-side once all chunks have been sent. This is what services like S3 will do when uploading files that are multiple megabytes or even gigabytes in size.
10mb is the default limitation in Spatie Media library package. Could it be related to that config/medialibrary.php?
return [
/*
* The maximum file size of an item in bytes.
* Adding a larger file will result in an exception.
*/
'max_file_size' => 1024 * 1024 * 10,
@PovilasKorop what does their docs say about changing the value? That is a little over 10Mb
@jlrdw I don't think it's mentioned specifically somewhere in their docs. I just remember painfully bumping into that number myself, a long time ago :)
@PovilasKorop I've solved the problem, thank you very much.
@PovilasKorop The MediaLiabry Pro Livewire component seems not to read this config. I get the same error after changing to a higher amount.
@PovilasKorop Thank you Povilas. Was banging my head for a couple of hours, the debug mode is ON, maxfileupload is up, client body size is configured, Nginx conf is also configured for file size and still there was error, Your hint fixed it.
Status code gives 500 Error, it does not load, I think I do not know where to find the solution for this error is related to the script, but I need to be able to install it, I do not understand what to do, thank you very much for writing immediately to help
A helpful site, you are very good, thank you, I will write when the problem is solved, thank you again.
I'm getting the same error again
[2023-01-06 18:18:46] production.ERROR: File /tmp/phpEvFv4w has a size of 44.35 MB which is greater than the maximum allowed 10 MB {"userId":7,"exception":"[object] (Spatie\MediaLibrary\MediaCollections\Exceptions\FileIsTooBig(code: 0): File /tmp/phpEvFv4w has a size of 44.35 MB which is greater than the maximum allowed 10 MB at /var/www/vhosts/vawog.com/api.vawog.com/vendor/spatie/laravel-medialibrary/src/MediaCollections/Exceptions/FileIsTooBig.php:15)
Hi,
I ran into the same error, and turns out it's the Livewire's config for temporary_file_upload that was limited to 12288KB. If someone is having the same issue, using Livewire (V3 in my case), this might be useful:
Publish the livewire config file:
php artisan livewire:publish --config
Update the temporary_file_upload rules - set the max value:
'temporary_file_upload' => [
'disk' => null, // Example: 'local', 's3' | Default: 'default'
'rules' => ['max:64000'], // HERE!
'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp'
'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1'
'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs...
'png', 'gif', 'bmp', 'svg', 'wav', 'mp4',
'mov', 'avi', 'wmv', 'mp3', 'm4a',
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
],
'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated...
],
Clear your config cache and you're done!
@thomas_rm Thanks! I am using Filament and Spatie Media Library. I had configured both of these to use a higher limit, but I was still getting an error due to the Livewire default limit.
@sctmp Did you fix this error?
Please or to participate in this conversation.