|
How to submit file to J2EE server? |
|
Written by joe
|
|
Tuesday, 08 February 2005 |
|
This might be an old topic, but it would be handy to write down the common solutions for the file upload. Just for your reference:
Once you process the form-data stream into the uploaded file, you can then either write it to disk, write it to a database, or process it as an InputStream, depending on your needs. See How can I access or create a file or folder in the current directory from inside a servlet? and other questions in the Servlets:Files Topic for information on writing files from a Servlet.
Personally, I'd highly recommend COS package for file upload purpose. Reference as below:
http://www.thebook-demo.com/java-server/servlets/upload.html
http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html
http://www.servlets.com/cos/ (download the cos package from here)
|