Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

**** com.oreilly.servlet.MultipartRequest Error ***

 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i keep getting this errors:
java.lang.IllegalArgumentException: Not a directory: malhar
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:109)
at Upload_Test.doPost(Upload_Test.java:27)
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:335)
at org.apache.jserv.JServConnection.run(JServConnection.java:197)
at java.lang.Thread.run(Thread.java)
when i give :
MultipartRequest multi=new MultipartRequest(req,"malhar",5* 1024 * 1024);
even after creating directories name "malhar" on the server.
pls need yr help urgently
thnx
malhar
 
Dmitriy Pavlyuk
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to set absolute path to this directory or valid the relative path.
Dmitriy.
 
arvind
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi! malhar,
give the real path by using the foll. servlet:i.e(req,www/htdocs/server-name/malhar,1024*1024)
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class test2 extends HttpServlet
{

public void doGet(
HttpServletRequestrequest,
HttpServletResponseresponse
) throws ServletException, IOException
{
PrintWriterout;
Stringtitle = "Output";
// set content type and other response header fields first
response.setContentType("text/html");
// then write the data of the response
out = response.getWriter();

out.println("checking for include files");
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
out.println("<H1>" + title + "</H1>");
out.println("path information "+ request.getPathInfo());
out.println("<br>");
out.println("servlet information "+ request.getServletPath());
out.println("<br>");
out.println("realpath information "+ request.getRealPath("/"));
out.println("<br>");
out.println("protocol information "+ request.getProtocol());
out.println("</BODY></HTML>");
out.close();
}
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic