Skip to content
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

file_save_upload() is not notifying user when PHP upload limit is exceeded. #99

Open
marsdk opened this issue Oct 23, 2015 · 0 comments

Comments

@marsdk
Copy link

marsdk commented Oct 23, 2015

In includes/file.inc line 517 the following code takes care of handling the errors if something has occurred during file upload.

if (isset($_FILES['files']) && $_FILES['files']['name'][$source] && is_uploaded_file($_FILES['files']['tmp_name'][$source])) {

The issue is that if the PHP upload limit is reached the is_uploaded_file() function will return false and the error will never be returned correct to the user. The user gets an error, but just an message that the image could not be uploaded - not the "file is too large"-error. The is_uploaded_file() function should not be in this if-statement.

Perhaps $_FILES['files']['error'][$source] should be checked first as testing show that it gives a proper 1 as a result.

There are multiple patches for this, but it has never gotten into the master branch for drupalistic reasons. https://www.drupal.org/node/30520

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

No branches or pull requests

1 participant