I have set up upload_max_filesize and post_max_size to 32Mb in php.ini.
I am using Symfony2. I have created an entity that contains a file variable so that people can upload a file:
/**
* @Assert\File(maxSize="3M")
*/
public $file;
Fatal error: Allowed memory size of 150994944 bytes exhausted (tried to allocate 62353390 bytes) in /Applications/MAMP/htdocs/Symfony/vendor/symfony/src/Symfony/Component/HttpKernel/Profiler/Profiler.php on line 177
Is there a way to make the validator work when the file uploaded is higher than post_max_size? How is Symfony handling file uploads that are bigger than post_max_size?
This is an issue about PHP, not Symfony. As you limit POST params size, your submit request does even not "reach" controller.
As post_max_size limit all POST params, including files, you should define post_max_size higher than upload_max_filesize.
So now, your question seems to be related to this one : How to gracefully handle files that exceed PHP's `post_max_size`?
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