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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploading Images To A Database 1

Status
Not open for further replies.

overyde

Programmer
Joined
May 27, 2003
Messages
226
Location
ZA
Hi,
Can the actual images be stored in a database?
If so, how do I upload them and then call them from the database?
 
You can store images (or nearly any other kind of binary data) in a database.

However, I recommend against doing so, especially if you are programming for a web interface. I recommend storing your images on your filesystem, and storing just the filenames of your images in the database.

If you store your images in the database, when it comes time to display an image you will have to write the code to fetch the data, provide the correct content-type headers, and stream out the data. Why do all that when by fetching the name of the file from the database and making it available to the browser as an <IMG> tag, the web server can do all that for you?

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top