Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Perl Programming

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?
This discussion has been archived. No new comments can be posted.

Serving Graphics to Website from a Database?

Comments Filter:
  • Do the fields in the database contain the file name of the graphic or the actual data?
  • Why not use both the file system and the database?

    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
  • Just write an app that reads data from the database, then streams it raw across the connection with a content header like so:

    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.)

What good is a ticket to the good life, if you can't find the entrance?

Working...