upload images from jsp

C

chandu

in my project administrator will upload images into data base.when user
enters vth his id.the jsp file wil retrieve images and display.how can
i achieve this .whethere i need to store location of image or something
else.please help me in this regard
 
O

Oliver Wong

chandu said:
in my project administrator will upload images into data base.when user
enters vth his id.the jsp file wil retrieve images and display.how can
i achieve this .whethere i need to store location of image or something
else.please help me in this regard

You can either:

(1) store the bytes of the image itself in the DB.
(2) store it somewhere in the filesystem, and store its location in the
DB.

To give the image to the user:

(1) Have the HTTP server respond to the URL request by connecting to the
DB and returning the bytes of the image, instead of HTML data.
(2a) Link directly to the file on the file system if the file is in a
location that is shareable.
(2b) Have the HTTP server respond to the URL request by reading from the
file and returning the bytes of the image, instead of HTML data.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top