-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
File Upload Max Size #6441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Which version of Symfony do you use? Because this has been fixed a long time ago. |
I've just encountered the exact same issue on Symfony 2.2 - I had to change the upload_max_filesize in my php.ini file. |
Sorry I haven't responded @fabpot, I had this issue on a finished project and haven't had time to revisit it. I was using 2.1.7. If it comes up for me again I will try to track it down and try to give more insite into the potential issue. |
This PR was merged into the 2.1 branch. Commits ------- 7216cb0 [Validator] fix showing wrong max file size for upload errors Discussion ---------- [Validator] fix showing wrong max file size for upload errors this was because the maxSize option wasn't parsed correctly and simple string comparision could lead to wrong results, e.g. 200 > 1000M | Q | A | ------------- | --- | Bug fix? | [yes] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [yes|] | Fixed tickets | [#6441,#5551] | License | MIT Will apply cleanly to 2.2
Fixed remaining case where this could happen. |
I'm using Symfony 5.4 and the same problem occurs to me. In the php.ini I have set 8M and in the form type 5M. If I upload a file larger than 8M, it shows me the low level php warning (or another, I don't know) of "Length of XXXX bytes exceeds the limit of XXXXX bytes in Unknown On line 0" and leaves the form with a feeling strange. If I upload a 6M file it does show the message but I lose control in the previous case. how do I solve it? |
If you are validating a file upload with
@Asset\File(maxSize)
and the specified maxSize is greater than the value set forupload_max_filesize
in php.ini, the value of maxSize is returned in the error as the reason the upload failed.It would be nice if the message could specify that it was the value of
upload_max_filesize
that caused the file upload to fail and not the constraint.The text was updated successfully, but these errors were encountered: