General J2EE: File Upload. Best Practices
- Posted by: jason priestly
- Posted on: December 04 2002 03:13 EST
What is the best way of doing file uploads to a webserver?
For example IIS, iPlanet or Apache.
I know there are many possibilities for example PUT, POST and WebDav. But which one is best for uploading files without having to create a servlet or some other custom code on the webserver?
Creating a custom servlet seems stupid to me since there is built in functionality in most servers for uploading of files.
The files that are uploaded can be 1Gb or more.
- File Upload. Best Practices by Web Master on December 04 2002 08:45 EST
- File Upload. Best Practices by Scott Taylor on December 09 2002 08:38 EST
Why not FTP? The user can login through the browser...
FTP can not be used for at least two reasons.
- FTP is insecure. Should be HTTPS.
- FTP requires more knowledge.
PUT is best I guess...
Yeah in your case, FTP is not an option.
I use Jakarta Struts for uploads. It makes uploading easy , by abstracting the muli-part request parsing (FormFile object). Struts has a upload example that comes with it.
Good Luck with whatever you decide...
"The Commons FileUpload package makes it easy to add robust, high-performance, file upload capability to your servlets and web applications." - http://jakarta.apache.org/commons/fileupload/