-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
file uploaded but $file->getErrorMessage(); throws error "was not uploaded due to unknown error" #28130
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
|
There's no misunderstanding. There's just poor documentation. |
@BernardA would you mind sending a doc PR to improve this please? |
@nicolas-grekas. I have no idea what a doc PR is. Can you elaborate? In the meantime I believe I found another issue with UploadedFile. Also look at Concerning the other issue I referred to above: In attempting to verify xabbuh's comments above, I forced an exception by setting a low
I also upgraded Symfony to latest, ie, 4.1.3, just in case. I was expecting to get a IniSizeFileException. Instead I got:
on
That would seem to mean that, of course, the file upload was stopped by upload_max_filesize, without an error. Then when I attempted to get $file by using
it come back empty. Note that I am using exactly the code from Symfony's cookbook , with the exception of line above, ie, $file = $form->get('imgFile')->getData(); |
A "doc PR" is a pull request to improve the documentation, on the symfony-doc repository: |
@BernardA The issue you describe in #28130 (comment) looks like it is the same as #27524. |
@nicolas-grekas. Before one can think about improving the documentation, one needs a code that works properly. We do not seem to be there yet. @xabbuh . I believe the basic issue is the same as the one you referenced. Additionally, ss I mentioned on symfony/symfony-docs#10145, there are some wrong assumptions on the code and comments on that documentation. By the way, I realized that wrong links appeared on my initial issue above. It should be |
Symfony version(s) affected: 4.0.4
Description
UploadedFile->getErrorMessage() says file "was not uploaded due to unknown error", while file was
actually uploaded and $_FILES['file']['error] shows no error.
How to reproduce
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: