tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Soons <>
Subject RE: Servlet 3.0 File Upload
Date Sat, 03 Sep 2011 12:23:57 GMT
You need to add a line in in your form:
<input type="text" name="filename" />

Then in your servlet GetPost() method you put this filename in a variable:
String filename;
filename = req.getParameter("filename");

Then instead of part.write("samplefile");

Jonathan Soons
From: Ole Ersoy []
Sent: Friday, September 02, 2011 6:50 PM
To: Tomcat Users List
Subject: Servlet 3.0 File Upload


I have a working file upload servlet, with the exception that it calls the uploaded file "samplefile"
instead of using the name of the file.  So if I upload different files, they all overwrite
each other.  Any ideas on how to fix this?  I used this tutorial to get it working:

- Ole

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message