Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploading a file to the server

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi buddies,
I have been trying to write a servlet which will upload a file to the server.
For that i used oreilly's MultiPartRequest class, but i get the following exception:
"java.io.IOException: Corrupt form data: no leading boundary at com.oreilly.servlet.MultipartRequest.readRequest(MultipartRequest.java, Compiled Code) at java.lang.Exception.(Exception.java, Compiled Code) at java.io.IOException.(IOException.java, Compiled Code) at com.oreilly.servlet.MultipartRequest.readRequest(MultipartRequest.java, Compiled Code) at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:140) at Anirban.Wizard.WizardUpload.processRequest(WizardUpload.java:55) at Anirban.Wizard.WizardUpload.doPost(WizardUpload.java:95) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at com.livesoftware.jrun.JRun.runServlet(JRun.java, Compiled Code) at com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java, Compiled Code) at com.livesoftware.jrun.JRunGeneric.handleProxyConnection(JRunGeneric.java, Compiled Code) at com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(JRunProxyServiceHandler.java, Compiled Code) at com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.java, Compiled Code) "
any ideas/help shall be appreciated.
Thanks
ani
 
henley
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that the form has the "multipart/form-data" enctype?
 
Sharon Adar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi anirban,
Can you tell me where I can get hold of the orielly java class library for use with servlets.
I urgently need to code a servlet to upload files.
Thanks
Sharon
 
henley
Greenhorn
Posts: 16
 
Salman Yasser
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the same exception when using AppletFile as a client side tool at HTML, but when using the input of type file no error occured
do you face the problem when using input of type file ?
On other hand any body can tell me why the request contains AppletFile generates such exception when trying to make an object of type MultipartRequest
l_MultipartRequest = new MultipartRequest(p_Request,
l_flTempFloder.getCanonicalPath(),
p_nMaximumfileSize); ??
 
Salman Yasser
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the same exception when using AppletFile as a client side tool at HTML, but when using the input of type file no error occured
do you face the problem when using input of type file ?
On other hand any body can tell me why the request contains AppletFile generates such exception when trying to make an object of type MultipartRequest
l_MultipartRequest = new MultipartRequest(p_Request,
l_flTempFloder.getCanonicalPath(),
p_nMaximumfileSize); ??
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every one who has posted in this thread.
Welcome to the JavaRanch! Please adjust your display name to meet
the JavaRanch Naming Policy. You can change it here.
Thanks!
and welcome to the JavaRanch!
 
Salman Yasser
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How could I print the Boundary ? from the request or what ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic