You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by deccico <de...@gmail.com> on 2007/02/01 12:56:38 UTC

file uploading

Hi, I am having some troubles trying to upload a file with struts 2.0.1

According to the log (which is at the end) the file is created but after
that is removed. Why?

Also I tried with the Showcase example that comes with Struts and the same
behavior seems to happen since the uploaded file do not appear in the
location where it should be. You can see it here:
http://www.smsgratisxpixel.es/struts2-showcase-2.0.1/fileupload/upload.action

By reading the forums I have seen different issues. Is there any bug related
to this functionality? Could anyone send a short example?

regards

Adrián


Log file:

2007-02-01 00:33:03,375 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.Dispatcher - saveDir=c:\struts_file
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.Dispatcher - maxSize=2097152
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.multipart.MultiPartRequest - Found item upload
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.multipart.MultiPartRequest - Item is a file
upload
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.multipart.MultiPartRequest - Found item
caption
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.multipart.MultiPartRequest - Item is a normal
form field
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.InstantiatingNullHandler - Entering
nullPropertyValue
[target=[com.opensymphony.xwork2.DefaultTextProvider@18c5e67],
property=struts]
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.DefaultActionProxy - Creating an DefaultActionProxy
for namespace / and action name doUpload
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.I18nInterceptor - intercept '//doUpload'
{ 
2007-02-01 00:33:03,390 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.I18nInterceptor - requested_locale=null
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.I18nInterceptor - before Locale=es_ES
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.InstantiatingNullHandler - Entering
nullPropertyValue [target=[ar.org.adrian.xm.user.FileUploadAction@16aa42e,
com.opensymphony.xwork2.DefaultTextProvider@18c5e67], property=struts]
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor - Setting
static parameters {}
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.ParametersInterceptor - Setting params
uploadFileName => [ README.txt ] uploadContentType => [ text/plain ] upload
=> [ c:\struts_file\upload__6301b048_1107a80562b__8000_00000002.tmp ]
caption => [ sdfsdf ] 
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Property: caption
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Class:
ar.org.adrian.xm.user.FileUploadAction
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Property: upload
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Class:
ar.org.adrian.xm.user.FileUploadAction
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Property: uploadContentType
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Class:
ar.org.adrian.xm.user.FileUploadAction
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Property: uploadFileName
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Class:
ar.org.adrian.xm.user.FileUploadAction
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.validator.ValidationInterceptor - Validating
//doUpload with method upload.
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor - Invoking
validate() on action ar.org.adrian.xm.user.FileUploadAction@16aa42e
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil - cannot find
method [validateUpload] in action
[ar.org.adrian.xm.user.FileUploadAction@16aa42e]
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil - cannot find
method [validateDoUpload] in action
[ar.org.adrian.xm.user.FileUploadAction@16aa42e]
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.DefaultActionInvocation - Executing action method =
upload
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.struts2.dispatcher.ServletDispatcherResult - Forwarding to
location /www/user/upload-success.jsp
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -
servletPath=/www/user/upload-success.jsp, pathInfo=null, queryString=null,
name=null
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -  Path Based Forward
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.InstantiatingNullHandler - Entering
nullPropertyValue [target=[ar.org.adrian.xm.user.FileUploadAction@16aa42e,
com.opensymphony.xwork2.DefaultTextProvider@18c5e67], property=org]
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - JspEngine -->
/www/user/upload-success.jsp
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 	     ServletPath:
/www/user/upload-success.jsp
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 	        PathInfo: null
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 	        RealPath: c:\Archivos de
programa\Apache Software Foundation\Tomcat
5.5\webapps\10m\www\user\upload-success.jsp
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 	      RequestURI:
/10m/www/user/upload-success.jsp
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 	     QueryString: null
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 	  Request Params: 
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.jasper.servlet.JspServlet - 		 caption = sdfsdf
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Property: upload
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.XWorkConverter - Class:
ar.org.adrian.xm.user.FileUploadAction
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -  Disabling the response for
futher output
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.util.InstantiatingNullHandler - Entering
nullPropertyValue [target=[ar.org.adrian.xm.user.FileUploadAction@16aa42e,
com.opensymphony.xwork2.DefaultTextProvider@18c5e67], property=struts]
2007-02-01 00:33:03,406 [http-8080-Processor24] INFO 
org.apache.struts2.interceptor.FileUploadInterceptor - Removing file upload
c:\struts_file\upload__6301b048_1107a80562b__8000_00000002.tmp
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.I18nInterceptor - after Locale=es_ES
2007-02-01 00:33:03,406 [http-8080-Processor24] DEBUG
com.opensymphony.xwork2.interceptor.I18nInterceptor - intercept } 
2007-02-01 00:33:08,140
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286388140 sessioncount 1
2007-02-01 00:33:08,140
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:34:08,171
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286448171 sessioncount 1
2007-02-01 00:34:08,171
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:35:08,203
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286508203 sessioncount 1
2007-02-01 00:35:08,203
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:36:08,265
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286568265 sessioncount 1
2007-02-01 00:36:08,265
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:37:08,296
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286628296 sessioncount 1
2007-02-01 00:37:08,296
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:38:08,609
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286688609 sessioncount 1
2007-02-01 00:38:08,609
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:39:08,750
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286748750 sessioncount 1
2007-02-01 00:39:08,750
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:40:08,812
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286808812 sessioncount 1
2007-02-01 00:40:08,812
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:41:08,828
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286868828 sessioncount 1
2007-02-01 00:41:08,828
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:42:08,859
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286928859 sessioncount 1
2007-02-01 00:42:08,859
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0
2007-02-01 00:43:08,875
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - Start expire sessions
StandardManager at 1170286988875 sessioncount 1
2007-02-01 00:43:08,875
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
org.apache.catalina.session.ManagerBase - End expire sessions
StandardManager processingTime 0 expired sessions: 0

-- 
View this message in context: http://www.nabble.com/file-uploading-tf3154407.html#a8746969
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


Re: file uploading

Posted by deccico <de...@gmail.com>.
The descripted behavior seems to me as unusual since it's not documented
anywhere. Anyway, I followed your advice and it works. 

Thx!



Jia Guo wrote:
> 
> I think you should copy the file and save to where you want it be by
> yourself inside you Action.
> 
> 
> 2007/2/1, deccico <de...@gmail.com>:
>>
>>
>> Hi, I am having some troubles trying to upload a file with struts 2.0.1
>>
>> According to the log (which is at the end) the file is created but after
>> that is removed. Why?
>>
>> o Jia
> 
> 

-- 
View this message in context: http://www.nabble.com/file-uploading-tf3154407.html#a8761252
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


Re: file uploading

Posted by Jia Guo <gu...@gmail.com>.
I think you should copy the file and save to where you want it be by
yourself inside you Action.


2007/2/1, deccico <de...@gmail.com>:
>
>
> Hi, I am having some troubles trying to upload a file with struts 2.0.1
>
> According to the log (which is at the end) the file is created but after
> that is removed. Why?
>
> o Jia