I have a form in Symfony where the user uploads files to. These files can be up to 50Mb in size.
However, when I try to upload a file that is about 10Mb (before this, the files were no bigger than 7.2Mb) the form reloads with this error:
The uploaded file was too large. Please try to upload a smaller file
This is a validation error, it doesn't appear as a proper Symfony2 error.
I've set the upload_max_filesize
setting in the PHP.ini file to 50MB, so a 10MB file shouldn't be an issue?
To increaes file upload size in PHP, you need to modify the upload_max_filesize and post_max_size variable's in your php. ini file. In addition, you can also set the maximum number of files allowed to be uploaded simultaneously, in a single request, using the max_file_uploads .
The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.
You need to set both of these in the php.ini:
post_max_size = 50M
upload_max_filesize = 50M
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With