struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hisameer <>
Subject Re: File upload issue with Struts 2.1.6 (uploaded file is always null in action)
Date Fri, 25 Sep 2009 19:55:20 GMT

Hi Dale,

I have added two jar files in the application these jar files are:
commons-fileupload-1.2.1.jar,commons-io-1.3.2.jar.Let me know if there is a
need to add additional jars. I am not getting any file name or content type
so I think nothing is passed to the action class, all the values are null.

 The interceptors which I am using is mentioned in action mapping itself.
The action mapping is: 

<action name="doUpload" class="com.jctaylor.breg.action.FileUploadAction"
			<interceptor-ref name="basicStack" />
			<interceptor-ref name="fileUpload">
			<interceptor-ref name="validation" />
			<interceptor-ref name="workflow" />

DNewfield wrote:
> hisameer wrote:
>> Thanks for your reply. I tried to put the method public void
>> setUploadFile(File file) but no success, file is still null in the
>> action.
> Are the other two setters (ContentType, FileName) called?
> Do you have the appropriate interceptor in place for this action?
> I believe there's a .jar required for file upload that isn't part of the 
> standard struts you have that in WEB-INF/lib/?
> -Dale
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Struts - User mailing list archive at

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

View raw message