• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

uploading an image functionality

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I think she's lovely. It's this tiny ad that called her crazy:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic