M
Matt
Should we use enctype=multipart/form-data in the form, I know it is recommended
if the form has <input type="file">. My form has <input type="file"> and other
html controls.
I tried the following,
form.html
=========
<FORM NAME="InputForm" ACTION="test.jsp" METHOD="POST" enctype=multipart/form-data>
<P><input type=text name="name" size=80>
<P><input type=file name="filename" size=80>
<P><input type="submit" value="Upload File Test">
</FORM>
test.jsp
=========
<p><%= "filename = " + request.getParameter("filename") %>
<p><%= "name = " + request.getParameter("name") %>
It will output
filename = null
name = null
I don't understand why, but if i remove enctype=multipart/form-data in the form,
then I am able to get the data.
Please advise. Thanks!!
if the form has <input type="file">. My form has <input type="file"> and other
html controls.
I tried the following,
form.html
=========
<FORM NAME="InputForm" ACTION="test.jsp" METHOD="POST" enctype=multipart/form-data>
<P><input type=text name="name" size=80>
<P><input type=file name="filename" size=80>
<P><input type="submit" value="Upload File Test">
</FORM>
test.jsp
=========
<p><%= "filename = " + request.getParameter("filename") %>
<p><%= "name = " + request.getParameter("name") %>
It will output
filename = null
name = null
I don't understand why, but if i remove enctype=multipart/form-data in the form,
then I am able to get the data.
Please advise. Thanks!!