You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bedilu Habte <ha...@cai.de> on 2001/08/28 10:17:48 UTC
Problem with POST method
I have the following form in my jsp-file used to uoload a file:
<FORM ENCTYPE="multipart/form-data"
ACTION='<%= response.encodeURL("/myWeb/servlet/UPDoc") %>'
METHOD="POST" >
Which file do you want to Upload ? <INPUT TYPE="FILE" NAME="upDoc" />
<P />
<INPUT TYPE="submit" VALUE="Upload" />
</FORM>
The servlet "UPDoc" is used to pass the content of the uploaded file
to a helper class which saves the same into a database.
The problem is that the file is not uploaded at the first place.
Following is part of the check I made in the servlet code before accessing
any of
the other parameters:
// the servlet inputstream
ServletInputStream sis = request.getInputStream();
int len = sis.available(); // this is always 0
....
out.println("protocol = "+request.getProtocol()+"<br />"); //
gives HTTP/1.0
I used tomcat-3.2.1 and changed to version 3.2.3. This doesn't help either.
please HELP!!
Bedilu.