java.io.FileNotFoundException when writing uploaded file to disk via getRealPath()
问题 Glassfish seems to be adding extra to the path I want to save my image file too, is there some way to use only the absolute path my servlet gets with String appPath = request.getServletContext().getRealPath(""); ? I have spent days trying different methods to upload an image file and have a servlet save it to disk. I used this example: http://www.codejava.net/java-ee/servlet/how-to-write-upload-file-servlet-with-servlet-30-api Using debug I can see the file name and path information is