Hi all
I am having this little problem. I am trying to upload a file to a servlet
from a form on web-page. I am using MultipartRequest class from Mr Jason
Hunter great class library.
But I keep getting null into my sHTML = multi.getParameter(string)
this is the html code:
<form method="POST" ENCTYPE="multipart/form-data"
action="/servlet/XtraServlet.TestServlet">
<p align="center">Web page<INPUT TYPE=FILE NAME="HTML"></p>
<p align="center"><input type="submit" value="Submit" name="B1"></p>
</form>
and this is the servlet code:
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
PrintWriter pfUttak = res.getWriter();
MultipartRequest multi = new MultipartRequest(req, ".");
String sHTML = multi.getParameter("HTML");
pfUttak.println(req.getContentType() + "<br>" + "Page : " + sHTML);
}
and it return this:
multipart/form-data; boundary=---------------------------7cf10a2618414b4
Page : null
I hope somebody can help me with this problem
best regards
Palli
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html