• Post Reply Bookmark Topic Watch Topic
  • New Topic

error during uploading files - no parametres in request  RSS feed

 
max afinogenov
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys.
I have a simple html page

with 2 text fields and 1 file field.
This is my simple servlet:
After sending request, this servlet shows, that it hasn't received any param. Answer page is
<html>
</html>
But if I use
/*ServletInputStream in = request.getInputStream();
int i = in.read();
while (i!=-1) {
pw.print((char)i);
i=in.read();
}
pw.close();*/
then i see all the HTTP request (in the answer page). I have also tried to get params using request.getParameter("..."), but the result was the same.
When i dont use tag enctype="multipart/form-data", all is ok (of course, no file was uploaded). Browser is mozilla.
Applications .war file is deployed using weblogic (because its a test of interface of greater application).
Can you help me with this problem, please?
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Max,

it's true: if you upload a file, you can't use request.getParameter(...) anymore.

I suggest you have a look at The Commons FileUpload package (see http://commons.apache.org/fileupload/)

Herman
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!