I am trying to upload files larger than 2Mo and I have this error in 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 restarted apache
the most likely apache uses a different php than the one you are editing ini
just phpinfo();
phpinfo();
in AppKernel.php or app.php
and find the correct ini directory
in the example
Loaded Configuration File => /usr/local/etc/php/5.4/php.ini
You can also set your custom values ββin the .htaccess file in the root folder of your web directory:
# File size settings for uploads php_value upload_max_filesize 50M php_value post_max_size 50M