Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to store Images

Status
Not open for further replies.

venur

MIS
Aug 26, 2003
418
US
Hi,

I want to store images. But I am little confused on how to go about it and what is the best way to store the image.

Do I need to store the image in the DB, I am using oracle.
The problem with this approach is the storage space in DB as I think there would be atleast 150 new images every day.

Or

Do I need to store the image path in the DB and the file in a directory good and normal approach. But the problem with this is the image file will be created by the App Server were the app server is running and my Web Server is running in the different place might not be in the same network or domain.

Or

I can store the image as a string in the DB and decode that string into image while displaying on to the web page but its slow as It involves lot of IO Operations and the DB space too.

Constraints what I have are

1.I dont want to replicate the images (should be at one place).
2.It should be fast enough when I access them from the web page.

I appreciate and look forward for the suggestions.

Thanks,
-Venu



 
Given constraint #2 the simplest solution is to store the files on disk. This allows the server to cache the images. It further allows the browser to cache images as well. There might be a way to produce the HTTP to tell the browser that the image has not changed from a dynamic source like a database but that is obviously a more complex design and would still require a query of the database to get the datetime information.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top