Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Using MultipartRequest

 
Carlos Matus
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the multipart request classes from O'Reilly in my application, that class works fine in my windows NT workstation under TomCat.
However now my applications is moved to a Sun solaris server, when I try to upload a file, class seams to work fine because not error is showed, but the file is not saved in the file system. I don't know why this strange behavior. I think it's necesary to flush or close something, but I'm not sure what.
My app makes sure that a directory exist and it has permission to write, actually it creates the directory before download file and it works ok.
Does any body knows how to correct that behavior ?
 
Vishnu Mohan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We also used the MultipartRequest .
We created a Directory PrintUpload Under Sun Solaris and gave read and write permission to it.
We upload the files to this directory.
Before Uploading I set the encoding(In a Servlet) as shown in the below Java Script embedded in JavaCode.
out.println(" document.frm.encoding="+"\"multipart/form-data\";");
out.println(" document.frm.method='POST'");
out.println(" document.frm.action="+"\"/jservlets/PrintAdmin"+"\";");
out.println(" document.frm.submit();");
--- Here 'out' is object of PrintWriter .
If u have also done this there is something else i'am missing
Hope it help's
 
arvind
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not able to upload files on my server(apache &jserv).I get the following error namely:
java.lang.IllegalArgumentException: Not a directory: ../yogesh
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:109)
at test.doPost(test.java:11)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java)
i used the following multipartrequest:
MultipartRequest multi = new MultipartRequest
(req,"../yogesh",5*1024*1024);
kindly suggest a solution(changes to be made) so that the files get uploaded in the folder yogesh.
 
Bhuvana Bala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi can u tell me the procedure ad the code to uplaod in Jsp.More Over I should upload only the pdf files. pl. help.I am stuck.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic