aspose file tools*
The moose likes Struts and the fly likes struts 2 multiple file upload save path to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 multiple file upload save path to database" Watch "struts 2 multiple file upload save path to database" New topic
Author

struts 2 multiple file upload save path to database

Alvito Colasco
Greenhorn

Joined: Jul 15, 2011
Posts: 1
I have a huge form in which multiple documents of different types are being uploaded. Doing the same in Struts 2 using the multiple file upload logic of struts.



These are the parameters of my class(action). The name of the form fields have to be "upload" as per the class.



(some fields may be optional to upload) The files get uploaded correctly using copyFile. However within the upload[] array, how do I know which file belongs to which parameter as they bear the same name "upload", as I need to save the filename to database.

Please advise.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi Alvito,

Refer this Link which will give you the idea.
Index will be same for the content and file name.

Regards
Jatan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts 2 multiple file upload save path to database