I am trying to upload files bigger than 2Mo and I have this error on my form
The file is too large. Allowed maximum size is 2 MiB.
This is my model
/**
* @var UploadedFile
*
* @Assert\File(maxSize = "32768k")
* @Assert\Valid()
*/
protected $file;
and in my php.ini
post_max_size = 50M
upload_max_filesize = 50M
And I have restarted apache
most possible apache uses another php than the one you edit the ini
just phpinfo();
at the AppKernel.php or app.php
and look for the directory of the correct ini
in example
Loaded Configuration File => /usr/local/etc/php/5.4/php.ini
You can also set your custom values in the .htaccess file at the root of your web/ directory:
# File size settings for uploads
php_value upload_max_filesize 50M
php_value post_max_size 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