tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ingvar Sigurður Alfreðsson <>
Subject enctype=multipart/form-data
Date Wed, 11 Oct 2000 15:26:06 GMT

I can´t seem to get this to work!
When I call a servlet with enctype=multipart/form-data in the form tag then
the servlet doens´t recognize any of the parameters in the form !!!
What am I doing wrong ?

I wrote this short test program so you ´ll see what I´m trying to do:

<form action=http://localhost:8080/test/Tester method=post
<INPUT name=post_from>
<INPUT name=post_to>
<INPUT type=file name=post_file>
<INPUT type=submit value=Send name=submit>

and the servlet doPost method...

   protected void doPost(HttpServletRequest request, HttpServletResponse
response) throws javax.servlet.ServletException,
      PrintWriter out = new PrintWriter (response.getOutputStream());
      out.println("from:" + request.getParameter("post_from"));
      out.println("to:" + request.getParameter("post_to"));
      out.println("file:" + request.getParameter("post_file"));

My result is: from: null to: null file: null

So I ask, have you got a clue why this is happening to me? What am I doing
wrong ?

Ingvar Sigurður Alfreðsson

View raw message