At 3:36 PM +1000 4/16/04, Andrew Stevens wrote:
Hi,

I've read various threads on this mailing list about uploading files, and
uploading MULTIPLE files. There seems to be some shortcomings.
Especially as I want to offer a theoretically infinite number of file
uploads in one form. 0 to 5 files is realistic. But I don't want to limit
it.

My understanding is that I will have to limit this because for each file
I'll need a getter and setter in my ActionForm.
ie: setFile1() setFile2() setFile3().

So... the compile of my ActionForm creates a limit on the number of files
able to be uploaded.

Is there no other way to do this?

You could certainly define a formbean with a property of type "FormFile[]" It's just another "indexed property".


I do think that there are good arguments for having your users upload ZIPs instead, but it all depends on the use case.

Note that there's a controller property called "memFileSize", which is the maximum size of an uploaded file which Struts will try to keep in memory before writing to disk. In practice, this involves creating a byte array of that size for each uploaded file, so if you have a large "memFileSize" and many uploads, you run some risk of running out of application memory. You just have to be aware of this when setting the value. I can't recall the default value, but it should be in the docs.

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to