That's great Wes.  I am using the file upload but only sparingly (and hacked) 
due to some existing glitches.

 

I read how the Stripes framework does file upload:  
http://www.stripesframework.org/display/stripes/File+Uploads

 

Thought you might find it interesting/useful..

 

Andy


 
> Date: Wed, 3 Jun 2009 16:48:56 -0400
> Subject: Re: About the "struts.multipart.saveDir" for file upload
> From: w...@wantii.com
> To: user@struts.apache.org
> 
> I don't know if I would suggest it, but you might be able to call -
> 
> Dispatcher.getInstance().setMultipartSaveDir(String path)
> 
> Now, I can't remember if there is one dispatcher per thread, so you
> might have to call it in an interceptor.
> 
> However, I would strongly suggest against doing that.
> 
> I am working on an enhanced file upload plugin right now and will
> probably commit it to the sandbox by tomorrow. The problem with the
> stock file upload capability is that the FileItemFactory and
> FileUpload objects are not available to be overridden, and hardly any
> configuration is made visible. So, I've got a new
> JakartaMultiPartRequest class I'll have out by tomorrow.
> 
> -Wes
> 
> On Wed, Jun 3, 2009 at 4:37 PM, Andy <andrh...@hotmail.com> wrote:
> >
> > It defaults but I think he's wondering how he can set the dir 
> > programatically.
> >
> >
> >
> >> Date: Wed, 3 Jun 2009 15:35:33 -0500
> >> Subject: Re: About the "struts.multipart.saveDir" for file upload
> >> From: burtonrho...@gmail.com
> >> To: user@struts.apache.org
> >>
> >> I wasn't aware that it was required. If you don't specify doesn't it
> >> default to the 'work' directory?
> >>
> >> On 6/3/09, Qunhuan Mei <q...@qm18.wanadoo.co.uk> wrote:
> >> >
> >> > Hi,
> >> >
> >> > When implementing file upload, it is required to specify an absolute
> >> > directory in struts.xml such as following:
> >> >
> >> > <constant name="struts.multipart.saveDir" value="C:/fileUploadTempDir"
> >> > />
> >> >
> >> > But this might be difficult to achieve, say when the project war is 
> >> > deployed
> >> > in a external shared server and we do not have much idea about the 
> >> > directory
> >> > structure of the target server machine.
> >> >
> >> > I was wondering if there is any recommended way to handle this issue.
> >> >
> >> > Ideally I would like to specify the directory in java code where I can
> >> > detect the current working directory and specify the saveDir 
> >> > accordingly. Is
> >> > this possible?
> >> >
> >> > Many thanks in advance,
> >> >
> >> > Qunhuan
> >> >
> >> >
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> > For additional commands, e-mail: user-h...@struts.apache.org
> >> >
> >> >
> >>
> >> --
> >> Sent from my mobile device
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >
> > _________________________________________________________________
> > Windows Liveā„¢: Keep your life in sync.
> > http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009
> 
> 
> 
> -- 
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_________________________________________________________________
Insert movie times and more without leaving HotmailĀ®. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

Reply via email to