开发者

How to increase the upload limit for files on a Symfony 2 form?

开发者 https://www.devze.com 2023-04-13 08:45 出处:网络
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 10开发者_如何学运维Mb (before this, the files were

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 10开发者_如何学运维Mb (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?


You need to set both of these in the php.ini:

post_max_size = 50M

upload_max_filesize = 50M
0

精彩评论

暂无评论...
验证码 换一张
取 消