I am getting this error, which I believe is the same one mentioned in
previous messages about Websphere 2.0 on NT.
"java.io.IOException: Separation boundary was not specified"
I downloaded the version of com.orielly.servlet package that was updated
1/5/00. I checked inside the code and the readRequest method does have
the new code in it. I also checked the class file and it was created
1/5/00 at 11:35. I am using Websphere 2.0 for the AS/400 and have
loaded the com.oreilly.servlet package up to the AS/400 and it is being
found.
Does anyone know what the problem might be?
Thanks!!
Here is my code: (copied out of Jason Hunters' Java Servlet Programming
book, page 110-111 Example 4-17.
public void uploadFile(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException, IOException
{
doPost (req, resp);
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
try {
MultipartRequest multi = new MultipartRequest(req,
"/QIBM/ProdData/IBMWebAS/servlets/savedfiles/", 5 * 1024 * 1024);
out.println("<HTML>");
out.println("<HEAD><TITLE>UploadTest</TITLE></HEAD>");
out.println("<BODY>");
out.println("<H1>UploadTest</H1>");
out.println("<h3>Params:</h3>");
out.println("<PRE>");
Enumeration params = multi.getParameterNames();
while (params.hasMoreElements()) {
String name = (String)params.nextElement();
String value = multi.getParameter(name);
out.println(name + " = " + value);
}
out.println("</PRE>");
out.println("<H3>Files:</H3>");
out.println("<PRE>");
Enumeration files = multi.getFileNames();
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename =
multi.getFilesystemName(name);
String type = multi.getContentType(name);
//new try String type =
multi.getParameterValues(name);
//another try String type =
req.getHeader("Content-Type");
File f = multi.getFile(name);
out.println("name: " + name);
out.println("filename: " + filename);
out.println("type: " + type);
if (f
!=null) {
out.println("length: " + f.length());
out.println();
}
out.println("</PRE>");
}
}
catch (Exception e) {
out.println("<pre>");
e.printStackTrace(out);
out.println("</pre>");
}
out.println("</body></html>");
}
Shirley Powers
___________________________________________________________________________
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