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

P

Paul Smith

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
 
P

Paul Smith

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top