struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hisameer <cool_sameer_fo...@yahoo.com>
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"
			method="uploadFile">
			<interceptor-ref name="basicStack" />
			<interceptor-ref name="fileUpload">
				image/jpeg,image/gif,image/png,image/bmp,image.jpg
			</interceptor-ref>
			<interceptor-ref name="validation" />
			<interceptor-ref name="workflow" />
			<result
name="input">/jctaylor/pages/insuranceApplication/fileUploadExample.jsp
			</result>
			<result
name="success">/jctaylor/pages/insuranceApplication/fileUploadExample.jsp
			</result>
			<result
name="error">/jctaylor/pages/insuranceApplication/fileUploadExample.jsp
			</result>
		</action>



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 distribution...do you have that in WEB-INF/lib/?
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/File-upload-issue-with-Struts-2.1.6-%28uploaded-file-is-always-null-in-action%29-tp25614736p25618257.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message