I implement this as follows:

On session creation I create a directory in an 'uploads' directory using
session id for the name

Uploading a file copies the file into the session upload directory and adds
the filename (as a String) to a collection on my session scoped form bean.

On submission of the form the full paths to the files, in the session upload
directory, are passed to my business layer which processes them.

On session destruction the session upload directory is removed.

Paul

> -----Original Message-----
> From: Jim Collins [mailto:[EMAIL PROTECTED]
> Sent: 24 June 2004 23:19
> To: Struts Users Mailing List
> Subject: [OT] File upload design question
> 
> 
> Hi,
> 
> Appologies for the off topic posting. I am writing an 
> application where a
> user fills in a form, can attach some files and when they 
> submit the form it
> kicks off a workflow and saves any attached files to a 
> content management
> system.
> 
> This works fine using the struts file upload tools. What I 
> would like to do
> though is have it work in a similar fasion to Yahoo mail when 
> you send an
> email with attachments. The user when filling the form out 
> attaches some
> files, these are then uploaded to the server. When the user 
> then submits the
> form the workflow is kicked up and the files that were 
> uploaded are moved to
> the content management system.
> 
> The files are only copied across if the user submits the 
> form. If the user
> uploads some files and then decide not to submit the form the 
> files should
> be deleted.from the server.
> 
> Does anyone have any ideas on a design for this so that I 
> don't end up with
> lots of orphan files on the server and when the user submits 
> a form the
> correct files are copied to the content management system?
> 
> Thanks
> 
> Jim
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**********************************************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**********************************************************************


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

Reply via email to