Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploading an image functionality

 
Rina Khan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
COuld someone kindly explain the process of uploading your pictures on some of the websites where a user enters his profile and then, upload an image. I'm not looking for a code just curious as to how it works and what kind of technolgies (Servlets or Javascript) they use.Im a beginner in all this and jsut want to add to my knowledge. Again, not looking for a code , just want to know the process and whats best to use (Java or Javascript)..hope i made my questions clear. THanks.
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rina,
Its the same as file Upload, you can upload any sort of file. You can use various file upload components for that or write your own. And thats basically done using Servlets.
hth
MB
 
Torsten Schippel
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any number of technologies can do http file uploads. For a servlet/.war solution, see:
http://filenabber.com/filenabber.html
For a nice PHP solution, see
http://gallery.sourceforge.net/
Brian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic