File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Error 92 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error 92" Watch "Error 92" New topic
Author

Error 92

sojan chandy
Greenhorn

Joined: Mar 18, 2007
Posts: 24
i was tring to upload a file, i don kno why its not working. can any body help me in finding what actually the mistake is?

FileUpld.java 14: illegal character:\92
out.println("file upload success" <a href=\"/jspbook/files/");




package com.jspbook;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.commons.fileuploads.*;

public class FileUpld extends HttpServlet {
public void doPost(HttpServletRequest req,HttpServletResponse res)
throws IOException,ServletException{
res.setContentType("text/plain");
PrintWriter out=res.getWriter();
out.println("<html>");
out.println("file upload success" <a href=\"/jspbook/files/");
out.println("\">Click here to browse");
out.println(files</a><br>");
ServletContext sc= getServletContext();
String path=sc.getRealPath("/files");
org.apache.commons.fileuploads fu = new org.apache.commons.fileuploads.FileUpload();


fu.setSizeMax(-1);
fu.setRepositoryPath("/test/todelete");
try
{
List l=fu.parseRequest(req)
Iterator i=l.iterator();
}
while(i.hasNext())
{
FileItem fi=(FileItem)i.next();
fi.write(path+"/"fi.getName());
}
}
catch (Exception e)
{
throw new ServletException(e);
}
out.println("</html>");
}


public void doGet(HttpServletRequest req,HttpServletResponse res)
throws IOException,ServletException
{
doPost(req,res);
}
}

tnx in advance
[ March 25, 2007: Message edited by: sojan chandy ]
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I think you missed a ". You have to escape each one if it's in a String.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error 92
 
Similar Threads
Where to place the jar files
Please tell the reason for errors in the code. CODE and Errors given
problem in using Servlet API for file upload
Detailed description for william : regarding JAR files
Has anybody FileUpload.class containing setSizeMax() method?