Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTTP Upload question ...

14 views
Skip to first unread message

Larry Wright

unread,
Oct 16, 2000, 3:00:00 AM10/16/00
to
Hi,

I have tried using Oreilly's sample on how to upload a file to a server
using a servlet.

I am getting this error stating that the posted content is not
multipart/form-data:

a) What are the other types of data I could be sending for a simple
file upload?
b) Why am I getting the error?
c) Are there any more explicit examples that will do the trick for me?

Here is the trace info I am getting to my browser:

java.io.IOException: Posted content type isn't multipart/form-data
at
com.oreilly.servlet.MultipartRequest.readRequest(MultipartRequest.java:339)

at
com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:150)
at tecj001.UploadTest.doPost(UploadTest.java:25)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:576)
at
com.sun.server.ServletState.callService(ServletState.java:303)
at
com.sun.server.ServletManager.callServletService(ServletManager.java:1361)

at
com.ibm.servlet.service.SEServletManager.callServletService(SEServletManager.java:116)

at
com.sun.server.http.InvokerServlet.service(InvokerServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:576)
at
com.sun.server.ServletState.callService(ServletState.java:303)
at
com.sun.server.ServletManager.callServletService(ServletManager.java:1361)

at
com.ibm.servlet.service.SEServletManager.callServletService(SEServletManager.java:116)

at
com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:415)

at
com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:90)

at com.sun.server.http.stages.Runner.process(Runner.java:71)
at com.sun.server.ProcessingSupport.process(Compiled Code)
at com.sun.server.Service.process(Service.java:229)
at
com.ibm.servlet.service.SELauncher.processMultiThreaded(SEServlet.java:468)

at com.ibm.servlet.service.SEServlet.service(Compiled Code)
at
com.ibm.servlet.ServletSystemImp.invoke(ServletSystemImp.java:471)
at
com.ibm.servlet.ServletSystem.icsInvoke(ServletSystem.java:376)

If anyone can help, I'll be truly grateful! Thanks,

Larry


Chemi

unread,
Oct 16, 2000, 3:00:00 AM10/16/00
to
Larry, check the HTML form you are using, did you set the type?

Regards,

Chemi.

Larry Wright

unread,
Oct 16, 2000, 3:00:00 AM10/16/00
to
Chemi wrote:

> Larry, check the HTML form you are using, did you set the type?

I think that it is being set, but I am not an HTML expert ... Here's the code being used for
HTML.
Does it look proper?

<FORM ACTION="/servlet/UploadTest" ENCTYPE="multipart/form-data" METHOD=POST>
What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
<INPUT TYPE=SUBMIT>
</FORM>

Thanks,

Larry

0 new messages