Page 1 of 1

About Question enthuware.jwpv6.2.1110 :

Posted: Sun May 10, 2015 5:54 am
by Viorel Ghelbert
Hello,

The HTML form does not actually submit the file, but only sends its name as a regular POST parameter:
POST /myapp/SaveServlet HTTP/1.1
...
Content-Type: application/x-www-form-urlencoded
...
name=UPLOADME.txt
which can be accessed using the first option:

Code: Select all

request.getParameter("name");
(in addition to getInputStream() and getReader()).

This happens because the form does not specify an enctype, and the default is application/x-www-form-urlencoded

To make the form upload the file it should have

Code: Select all

enctype="multipart/form-data"

Re: About Question enthuware.jwpv6.2.1110 :

Posted: Sun May 10, 2015 8:46 pm
by admin
Added.
thank you for your feedback!