You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by udaykumar <ta...@gmail.com> on 2008/03/19 11:19:10 UTC

File Upload problem

I am using struts and have an upload.jsp and its associated UploadForm.java
and UploadAction.java. The jsp's form has an enctype=multipart/form-data and
contains an html:file field to upload a file as well as a bunch of text
fields for metadata associated with the file. If an error occurs during
validation, the struts controller servlet forwards to the jsp with error
messages. The problem is that the filepath the user specified is no longer
present. Is there a way to restore this value so the user doesn't have to
complete this field again (the other text fields remain filled in). Thanks
in advance

-- 
View this message in context: http://www.nabble.com/File-Upload-problem-tp16142571p16142571.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


Re: File Upload problem

Posted by "David Durham, Jr." <da...@gmail.com>.
On Wed, Mar 19, 2008 at 5:19 AM, udaykumar <ta...@gmail.com> wrote:
>
>  I am using struts and have an upload.jsp and its associated UploadForm.java
>  and UploadAction.java. The jsp's form has an enctype=multipart/form-data and
>  contains an html:file field to upload a file as well as a bunch of text
>  fields for metadata associated with the file. If an error occurs during
>  validation, the struts controller servlet forwards to the jsp with error
>  messages. The problem is that the filepath the user specified is no longer
>  present. Is there a way to restore this value so the user doesn't have to
>  complete this field again (the other text fields remain filled in). Thanks
>  in advance

The issue is that inputs of type file are read-only to unsigned
javascript programs and of course the value attribute does not apply.
Otherwise, a page could try to hide a file input on a form with a
preset value of /etc/shadow or some other sensitive file, and have a
user unknowingly upload this file.

-Dave

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