Hi there, I have to upload files from a browser (local system) to a location on the web server. Am using JSP to do this. Am totally clueless on how to go about doing. Some tips would help a lot. Thanks Jack
hemanth kumar
Ranch Hand
Joined: Mar 15, 2001
Posts: 55
posted
0
Hi Jack There are several options that u can follow Code the Uploading part urself or take a ready made components Some of the readymade ones that i know are jspsmartupload. If u want to code it urself then here are some steps to follow U should use the <FILE> tag for choosing the file on ur page. Also the form tag should have ENCTYPE as multipart/form-data Heres a sample '<form id="frmUpload" name="frmUpload" METHOD="post" ENCTYPE="multipart/form-data">' Now when u click on the upload button in ur page,the file that is to be uploaded goes as Header data to the submitted page. In the submitted page code has to be written to read the header data and pluck out the File data from there and recreate the uploaded file in the server. There is a very nice explanation on how the Uploading process actually works given in 15seconds.com. Read that for a much clearer understanding. Hope this helps Regards Hemanth
jack nick
Ranch Hand
Joined: Jan 11, 2001
Posts: 96
posted
0
Thanks Hemanth, Will check this out
Andrew Shafer
Ranch Hand
Joined: Jan 19, 2001
Posts: 338
posted
0
A package that can be used to upload files and so much more: com.oreilly.servlet
available from servlets.com Free for use in non-comercial projects and free for use in commercial projects if you buy the guy's book. (read the license)