Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > rendering images from a database

Reply
Thread Tools

rendering images from a database

 
 
ccc31807
Guest
Posts: n/a
 
      11-03-2009
If you have a table in a database with an ID field (int), name
(varchar), a content-type field (varchar) and a data field (blob), and
you have binary data in the data field (like GIFs, JPEGs, PDFs, etc.),
you can display these directly in a new HTML page. A query from the
the database returns this:
id => 666
name => greg.jpg
content-type => image/jpeg
data => &w`l *� m :��mF�΄�A�4d��

How would you embed this data in an HTML page with a Content-Type of
text/html? The <img> element needs a src attribute, which I don't
have, and the <object> element likewise needs a URI for the data
attribute.

I can certainly display the "data" from the database, but it's
character based data (clubs, diamonds, hearts, and spades) rather than
the nice, pretty picture that's really there. Is there a PM that can
take a binary and turn it into something that will look like an image
in a browser?

Thanks, CC.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Question on rendering images from SQL database Blasting Cap ASP .Net 1 10-25-2006 07:51 PM
IE6 SP1 rendering vs IE6 SP2 rendering Peter Mount HTML 4 01-31-2006 08:01 AM
Problem rendering dynamically generated images on non localhost pc =?Utf-8?B?VGlt?= ASP .Net 1 12-01-2004 08:48 PM



Advertisments