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
Try to set absolute path to this directory or valid the relative path. Dmitriy.
arvind
Greenhorn
Joined: Aug 27, 2001
Posts: 11
posted
0
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(); } }