Hi Rina,
as Malhar stated its just a normal file upload. You do not need any JavaScript. In fact it is a normal post like any other form submission. The only difference is the encoding. The normal form POST is "application/x-www-form-urlencoded". The file upload is "multipart/form-data".
Using normal POST (login for example) your server component get just String like:
name=John&pasword=xxxxx
Using multipart/form-data POST your server component get something like:
Content-type: multipart/form-data, boundary=---AaB03x
-----AaB03x
content-disposition: form-data; name="anyField"
fieldData
-----AaB03x
content-disposition: form-data; name="upfile"; filename="image.jpg"
Content-Type: image/jpeg (depending on file type)
... image data...
-----AaB03x--
The server component which will decode it will be a servlet in Java. The servlet may use existing classes like
http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html.
HTTP file upload is defined by
RFC1867 HTH
Torsten
[ December 23, 2003: Message edited by: Torsten Schippel ]