Skip to content

Attempt to fix error when submitting empty file input #84

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

Merged
merged 2 commits into from
Jan 24, 2018
Merged

Attempt to fix error when submitting empty file input #84

merged 2 commits into from
Jan 24, 2018

Conversation

benjaminjonard
Copy link
Contributor

Attempt to fix #83

I used the function convertFileInformation from this symfony file as an example.

true
);
if (UPLOAD_ERR_NO_FILE == $value->getError()) {
$value = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should rename value to file fr the entire loop.

if (UPLOAD_ERR_OK == $value->getError()) {
file_put_contents($tmpname, (string)$value->getStream());
}
$value = new \Symfony\Component\HttpFoundation\File\UploadedFile(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ...UploadedFile as SymfonyFile

@andig
Copy link
Contributor

andig commented Jan 18, 2018

Please also check for Psr UploadedFile, not for React. Otherwise this should make perfect sense- much appreciated!

@andig
Copy link
Contributor

andig commented Jan 24, 2018

Lgtm- much appreciated!

@andig andig merged commit 2e8ec9e into php-pm:master Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when submitting form with empty file input
2 participants