Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   File upload servlet using MultipartRequest - file not created on the server (http://www.velocityreviews.com/forums/t128687-file-upload-servlet-using-multipartrequest-file-not-created-on-the-server.html)

Paul Smith 11-14-2003 02:03 PM

File upload servlet using MultipartRequest - file not created on the server
 
Hello All,

I am playing with Jason Hunter's MultipartRequest servlet to upload a
file to a server (Tomcat). However, the file is not appearing on the
server. I have added some println statements to FilePart.writeTo(File
fileOrDirectory). Everything appears as I would expect - the filename
and path are correct, and the number of bytes returned by the method
looks fine. But no file appears on the server. Has anyone else
experienced this?

Many thnaks in advance,
Paul

Paul Smith 11-17-2003 10:24 AM

Re: File upload servlet using MultipartRequest - file not created on the server
 
Actually the file does make it to the server, it just wasn't in the
directory I expected, given what parameters I was passing to the
constructor of MultipartRequest. The file is actually placed in the
directory from which the Tomcat server was started. As I am starting
it using the startup script in the bin directory under the server
root, this is the location that "." results in in the code below.

// Here we (rudely) write to the server root and impose 5 Meg limit.
MultipartRequest multi = new MultipartRequest(req, ".", 5 * 1024 *
1024);

Paul


All times are GMT. The time now is 03:02 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.