Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Struts: Array of FormFiles possible?

Thread view: 
Jens Riedel - 18 Jun 2007 06:26 GMT
Good morning,

I need to process a form which contains a variable number of file upload
and other input fields.
As far as I know I can use the following code to create an array of
strings for text fields like this:

<input type="text" name="myText[1]" ...
<input type="text" name="myText[2]" ...
...

But using Google I only found the information that this is not possible
for file upload fields because Struts doesn't support this array method
for FormFiles.

How can I process multiple file uploads if I don't know their number
before? (Because of the fact that the form structure depends on a
recursive data structure I don't even know the maximum number of
existing file uploads before page generation).

Thank you for hints,
Jens
Manish Pandit - 18 Jun 2007 06:40 GMT
> Good morning,
>
[quoted text clipped - 18 lines]
> Thank you for hints,
> Jens

You can use jakarta fileupload API (http://jakarta.apache.org/commons/
fileupload/) to do this. I posted quite a few messages on this topic
in the past, you can search on cljp and should get more information.
This API is simple API to handle multipart forms including multiple
file uploads.

-cheers,
Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.