The moose likes Servlets and the fly likes Problem Using MultipartRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem Using MultipartRequest " Watch "Problem Using MultipartRequest " New topic

Problem Using MultipartRequest

Carlos Matus

Joined: Aug 22, 2001
Posts: 2
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

Joined: Aug 24, 2001
Posts: 2
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

Joined: Aug 27, 2001
Posts: 11
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.(
at test.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jserv.JServConnection.processRequest(
i used the following multipartrequest:
MultipartRequest multi = new MultipartRequest
kindly suggest a solution(changes to be made) so that the files get uploaded in the folder yogesh.
Bhuvana Bala

Joined: Jul 19, 2001
Posts: 10
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.
I agree. Here's the link:
subject: Problem Using MultipartRequest
jQuery in Action, 3rd edition