This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Uploading a file by parsing request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploading a file by parsing request" Watch "Uploading a file by parsing request" New topic
Author

Uploading a file by parsing request

Fawad Ali
Ranch Hand

Joined: Dec 28, 2009
Posts: 112
Hi All,
I have a form where I place <input type="file" /> tags. When the form submits, I want to write the image to a server directory. So I cannot do it in the normal Struts 2.0 way. I have to parse the request and get the files out of it and write it to a server directory. I am using the following code. It works in Servlets but not in a Struts framework.



Line 25 of the above code returns either null or empty list. I call it as follows from a Struts action.



Any ideas on what I may be missing here and if there are any other alternatives, please let me know.

Thanks in advance.


Regards, Fawad Ali.
Software Engineer, Stafona Inc. - My Blog
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Uploading a file by parsing request
 
It's not a secret anymore!