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

百般思念 提交于 2020-03-14 08:43:21

问题


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?


回答1:


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

post_max_size = 50M

upload_max_filesize = 50M


来源:https://stackoverflow.com/questions/7795121/how-to-increase-the-upload-limit-for-files-on-a-symfony-2-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!