Skip to content Skip to sidebar Skip to footer

Fileupload Isformfield() Returning True When Submitting File

I am using Apache-Commons FileUpload library to upload files to a server. It was working fine, but suddenly when I am submitting the file, FileItem.isFormField() is returning true

Solution 1:

Maybe it's a typo but you are missing a "name" attribute, wich is mandatory.

<inputid="attach-btn"type="file" name="someFile" style="display:none"/>

After some testing, without a name in the field, the file input is not included in the List<FileItem>. You recieve just the submit input with a default value (in my case something like "send request").

Try it and tell us if it worked.

Post a Comment for "Fileupload Isformfield() Returning True When Submitting File"