File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
NT performance Error when uploading file.
NT Performance error when uploading file
Uploading both local and hosted files
FormFile path gets reset during submit
form to upload files