gonuldas / gwtupload

Automatically exported from code.google.com/p/gwtupload
Other
0 stars 0 forks source link

Feature: Option to allow submitting without a file #93

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

Please provide any additional information below.

I'm trying to use the SingleUploader to add an optional file attachment to a 
error report form, and after some confusion and discovering a bug in the wiki 
(one must use "fileItem.getString()" not "fileItem.getName()" to get the param 
value of non-file parameters), I noticed that I could send a report with a file 
attachment and text areas for subject, description, debug data etc. but the 
form won't submit unless there is a file selected. I don't want to require the 
users to create a screenshot, but I'd like to give the option to send one.

Tried to read the source, and it seems that the SubmitHandler cancels if the 
basename is null (possibly other restrictions too). For a plain file upload 
this is sensible, but if you want to have a form with an optional file upload 
this won't work. 

Would it be possible to add a setting to the file uploader to allow submitting 
without a file? Or am I using it wrong, are there any way of including an 
optional file to a form containing other inputs using a single submit?

Original issue reported on code.google.com by stein.st...@gmail.com on 16 Feb 2011 at 8:18

GoogleCodeExporter commented 8 years ago

Original comment by manuel.carrasco.m on 20 Feb 2011 at 9:47

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r918.

Original comment by manuel.carrasco.m on 29 Apr 2011 at 7:13

GoogleCodeExporter commented 8 years ago
Use this method to enable the feature, by default it is not possible to submit 
empty files.

uploader.avoidEmptyFiles(false);

- Manolo

Original comment by manuel.carrasco.m on 29 Apr 2011 at 7:15