This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Multipart form won't submit with Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multipart form won Watch "Multipart form won New topic
Author

Multipart form won't submit with Struts

Tomas George
Greenhorn

Joined: May 26, 2011
Posts: 1
I have a Struts 1.2 application that uses file upload in one of the pages. Before adding the `<html:file>` field and changed form type to `multipart/form-data` everything was ok. I was submitting the form through Javascript upon pressing a button. Now, with the input file in place and corresponding form type, when I press the button, the submit is not performed anymore. Nothing happens. Submission code is something like this:

myForm = document.getElementById('form1');
myForm.action = '/myproject/myaction.do';
myform.submit();

I removed the field and the `multipart/form-data` type and everything was fine again.

Then I just added `multipart/form-data` to the field and submit did not work again. I already spent several hours with this issue and I cannot find a solution. It seems really stupid and maybe you have an idea of what's going on.

I've installed live http headers plugin in Firefox and I noticed: - the form gets submitted (even though it will not call my Action class execute) -
the server returns HTTP/1.1 204 No Content Server: Apache-Coyote/1.1 X-Powered-By: Servlet 2.4; ....

Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multipart form won't submit with Struts
 
Similar Threads
form to upload files
FormFile path gets reset during submit
NT Performance error when uploading file
NT performance Error when uploading file.
Uploading both local and hosted files