Having a problem with a servlet posting from a form:
// index.jsp
<FORM ENCTYPE='multipart/form-data' method='POST' action='/test/uploadfile'>
  Your name: <input type="text" uploadername="name" /><br /> 
  <INPUT TYPE='file' NAME='filetoupload'>
  <INPUT TYPE='submit' VALUE='upload'>
</FORM>
// testservlet.java
protected void doPost(HttpServletRequest request, HttpServletResponse response) 
    throws ServletException, IOException 
{
    String name = req.getParameter("uploadername");
    if (name == null || name.length() < 0) {
        // seems to always be empty.
    }
}
So yeah the name parameter never seems to be sent. What am I doing wrong?
 
     
     
     
    