struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad, Kamakshya" <kpra...@capitalservicing.co.jp>
Subject RE: Multiple File Upload using Struts (number of files dynamic)
Date Thu, 08 Jul 2004 06:30:35 GMT
Hi,

In the form bean keep an array list of FormFile and use it similarly as
dynamic list control.

KP

-----Original Message-----
From: Viral_Thakkar [mailto:Viral_Thakkar@infosys.com] 
Sent: Thursday, July 08, 2004 3:01 PM
To: Struts Users Mailing List
Cc: Ketan_Bhat
Subject: Multiple File Upload using Struts (number of files dynamic)

Hi,
 
We are trying to implement uploading file via struts framework using
form bean. According to our requirement we have two scenarios' in which
we require uploading of our file.
1)       Uploading single file (single html:file control and a single
upload button in jsp page)
2)      Uploading multiple files (Multiple html:file controls on the
screen on the same form). 
The problem is that these number of html:file controls on the screen is
not fixed, it is dynamic. The user can click on an "Add More" button to
increase dynamically the number of files he/she wants to upload.
 
We have implemented the first scenario by using html:file tag on the JSP
and keeping a form bean with html control as one of its member
variables. In the action class we extract the value from the bean and
then upload the file using I/O streams. 
 
Now, for the second scenario we need to upload an indeterminate
(determined at run time) number of files but at the same time the number
of members in the bean class cannot be changed dynamically. 
 
So we either need a way to add members to a form bean dynamically or
some other mechanism which will handle this multiple upload requirement.
 
With Regards,
Viral

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message