Serving Graphics to Website from a Database? 8
Yussef ElSirgany writes "Does anyone one out there know how to dynamicaly serve graphics from fields in a database which are being accessed from a perl script? I know how to access the database and generate the html just not how to serve the graphics. ODBC(Text+Graphics) --> Perl --> Dynamic HTML Thanks!" Let's make this one interesting and cover not just ODBC, but Oracle, PostgreSQL, mSQL and mySQL as well. What databases worh the best for serving images to the web?
Data or file name (Score:1)
Why store the image? Store the link (Score:1)
Do you need to store the image in the database? If not why not just store the path to the file in the database and have the program grab the files accoring to their stored locations from the database
It's Easy (Score:1)
Content-type: image/jpeg
[image data...........]
You should be able to find examples all over the 'net. Look for CGI-related sites and hunt for graphics-related examples. I've found examples in Perl and Java quite easily before.
The harder part is getting the raw image data into the database in the first place, but only barely harder. (Hint: prepared statements.)