8000 File Upload Max Size · Issue #6441 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
ornj opened this issue Dec 20, 2012 · 5 comments
Closed

File Upload Max Size #6441

ornj opened this issue Dec 20, 2012 · 5 comments

Comments

@ornj
Copy link
ornj commented Dec 20, 2012

If you are validating a file upload with @Asset\File(maxSize) and the specified maxSize is greater than the value set for upload_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.

@fabpot
Copy link
Member
fabpot commented Jan 24, 2013

Which version of Symfony do you use? Because this has been fixed a long time ago.

@pvanliefland
Copy link

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.

@ornj
Copy link
Author
ornj commented Feb 18, 2013

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.

fabpot added a commit that referenced this issue Mar 13, 2013
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
@Tobion
Copy link
Contributor
Tobion commented Mar 13, 2013

Fixed remaining case where this could happen.

@Tobion Tobion closed this as completed Mar 13, 2013
@tejadong
Copy link
tejadong commented Jan 24, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0