tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: Tomcat 5.5 creates 0 byte files
Date Fri, 02 Jul 2010 13:28:36 GMT
On 02/07/2010 14:21, André Warnier wrote:
> Murat Birben wrote:
>> Ok, here is the html form:
>>
>>         <form action="ResourceUploadServlet" method="POST"
>> enctype="multipart/form-data">
>>                            <input type="file" name="Content" />
>>                             FileName :<input type="text"
>> name="FileName" />
>>                             Path    :<input  type="text" name="Path" />
>>                             <input type="submit" value="Submit" />
>>         </form>
>>
> Ok.
> First, you should probably change the <form> tag as follows :
>    <form action="/ResourceUploadServlet" method="POST"
>  enctype="multipart/form-data">

Better:

 action="<%= request.getContextPath() %>/ResourceUploadServlet"

Even better:

 action="<%= response.encodeURI(request.getContextPath() +
'/ResourceUploadServlet') %>"


p

> Next:
> When the browser sends this to the server, it will do this using a
> particular format, similar to the (internal) format of an email with
> attachments.
> This is what the part : enctype="multipart/form-data" is all about. Are
> you familiar with this ?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



Mime
View raw message