Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Servlet File Upload Issue

Status
Not open for further replies.

Ciarrai

Technical User
Jun 27, 2003
17
US
Hi,
I want to save a document on my local machine and then upload it to my Apache Tomcat file directory. I want to store the name and path in a mysql database and archive all the uploaded files.
I was wondering how best to tackle this problem using servlets? I know in ASP that the application of ABCUpload will handle the upload to the web server but I'm not quite so sure how it will work with servlets? OReilly have a multipart package...is this the easiest way? Any advice is greatly appreciated!
 
The oreilly multipart package is certainly a viable way of performing this action, however the terms of use are restricted to buying the &quot;Servlet Programming&quot; book by Jason Hunter. If you have bought this, then just use that. Else, you need to use the <file> html tag in your JSP/HTML file to upload the file, and then use the HttpServletRequest.getInputStream() to retrieve the file byte data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top