Closed (fixed)
Project:
Webform
Version:
6.x-2.9
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2009 at 14:27 UTC
Updated:
28 Feb 2011 at 23:08 UTC
I have a webform (6.x-2.9) which includes a (picture) file upload. I have set the max file size allowed to 2mb. When a user attempts to upload a file over 2mb the data is submitted (except for the file) and they get the following error msg on the confirmation page: "The uploaded file was unable to be saved. The destination directory may not be writable."
Am I able to display a more useful message to the user (and hopefully not submit the data until they have corrected their submission)?
Thanks
Phil
Comments
Comment #1
phoenix commentedI had the same issue. People mailed to say the got this error message after submitting their form:
"The uploaded file was unable to be saved. The destination directory may not be writable."
I checked and those submission got through, but the photo is missing.
Phil, thanks for reporting this! This saved me some time!
Comment #2
phoenix commentedAfter some more investigation, I see that the filefield has been configured with an upload limit of 800kb. In php the upload_file_size is 2M. Shouldn't there be an error message on submission of a picture that is too big?
Comment #3
phoenix commentedComment #4
phoenix commentedNow I figured it all out.
When a file is selected to upload, it is uploaded during the submission and the filesize is checked. When the limit set for the file component is exceeded an error message is shown to tell the user the picture is too big.
If the upload_max_filesize is too low, the file doesn't get uploaded and you get the weird: "The uploaded file was unable to be saved. The destination directory may not be writable."
This is done in: webform/components/file.inc
Is there another way to do a filesize check (javascript reading out size and passing it through to validation?). Because even with the upload_max_filesize set to 8M there will always be people trying to upload bigger images... And they will get the weird error message.
Thanks for some help !
Comment #5
dzepol commentedJust confirming I also get this error. It took me a little while to figure out why 1/4 of our submissions were missing their files and why no one complained of error (they still got a confirmation email). The form should not submit without the attachment. It would be great if we could customize or alter this message or add a redirect on error.
Comment #6
hefox commented#834254: Upload module tests if file uploads in submit, meaning node is saved but file isn't if file fails validation Similar issue in with core upload; move the uploading to validation then error out if doesn't save should work.
Comment #7
quicksketchThis is actually a Drupal core bug. See #30520: file_save_upload() not notifying user when PHP upload limit is exceeded.. I'm closing this issue since it hasn't seen any activity in several months.