struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Musachy Barroso <musa...@gmail.com>
Subject Re: Struts2: file upload not working - Help plzzzzzz
Date Thu, 09 Apr 2009 13:53:41 GMT
Try putting a breakpoint in the FileUploadInterceptor and see what is going on.

musachy

On Thu, Apr 9, 2009 at 9:37 AM, TRSP <telltosakthipriya@yahoo.co.in> wrote:
>
> I'm trying to do upload a file using struts2 file tag. Followed all the
> mentioned as given in
> http://struts.apache.org/2.0.11/docs/file-upload-interceptor.html. but still
> am not able to retreive the file contents in my action class. Below is the
> code snippet which i added.
> ApplicationResources.properties
> struts.messages.error.uploading=a general error that occurs when the file
> could not be uploaded
> struts.messages.error.file.too.large=occurs when the uploaded file is too
> large
> struts.messages.error.content.type.not.allowed=occurs when the uploaded file
> does not match the expected content types specified
>
> Struts.xml
>
>
>
>
>
>
>
>
>
>
>
>
>                /jsp/success.jsp
>
>
> MyAction.java
> import java.io.File;
> //The below properties with getter and setter methods defined
> private File subUploadFile; // The actual file
> private String uploadContentType; // The content type of the file
> private String uploadFileName; // The uploaded file name and path
>
> public String uploadFile() throws Exception {
>                System.out.println("Inside uploadFile() .....");
>                System.out.println("File : " + getSubUploadFile());
>                System.out.println("File Name : " + getUploadFileName());
>                System.out.println("Content type : " + getUploadContentType());
>                return SUCCESS;
>        }
>
>
> myForm.jsp
>
>
>
> All the S.O.P. are printing null
> --
> View this message in context: http://www.nabble.com/Struts2%3A-file-upload-not-working---Help-plzzzzzz-tp22971111p22971111.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Mime
View raw message