File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes uploading an image functionality Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "uploading an image functionality" Watch "uploading an image functionality" New topic

uploading an image functionality

Rina Khan

Joined: Dec 23, 2003
Posts: 1
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
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
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.

Malhar Barai
SOA & Java Book
Torsten Schippel
Ranch Hand

Joined: May 09, 2003
Posts: 62
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:
Using multipart/form-data POST your server component get something like:
Content-type: multipart/form-data, boundary=---AaB03x
content-disposition: form-data; name="anyField"
content-disposition: form-data; name="upfile"; filename="image.jpg"
Content-Type: image/jpeg (depending on file type)
... image data...
The server component which will decode it will be a servlet in Java. The servlet may use existing classes like
HTTP file upload is defined by
[ December 23, 2003: Message edited by: Torsten Schippel ]
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
Any number of technologies can do http file uploads. For a servlet/.war solution, see:
For a nice PHP solution, see

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: uploading an image functionality
It's not a secret anymore!