struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: how to dynamically generate several file upload fields
Date Wed, 11 Dec 2002 10:21:54 GMT
Well you can do it for text fields already - just pump out several fields
with the same name. Works for almost all field types actually.

...just not files :-(

I think to get multiple files working (ie: array of FormFile) would need
changes to the classes in the struts upload package. I would imagine that it
is not simple (mainly on the evidence that nobodys done it yet!).

-----Original Message-----
From: matthew yee-king []
Sent: Wednesday, December 11, 2002 18:10
To: Struts Users Mailing List
Subject: Re: how to dynamically generate several file upload fields

> Another idea you might try is similar to what I ended up doing. This
> involves having a single file input field. The user can only upload
> one file at a time, but after each upload they are brought back to the
> form to add more. This is implemented by having the form in session
> scope and the setFile() method (or whatever you call your file field)
> adds each FormFile that is set into it to a list. The advantage of
> this method is that it allows for any number of files , but has
> several disadvantages too - such as needing to use the session scope,
> and it feels (very) clunky to the user.

that sounds like the best solution to me for the moment. I need a quick
solution as ever ;)

> Im still trying to think up a nicer way to do it that covers all my
> needs. If you come up with something better do let me know as Id be
> most interested:-)

I'm thinking the best way would be to get into the taglibs and write
some new html: tags that let you generate sets of text fields or file
fields that are stored to an ActionForm's arrays in the same way you can
with the<html:select multiple="yes"..> tags.

thanks for the tips


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message