> > > On Wednesday, August 27, 2003, at 12:50 PM, Scott Taylor wrote: > > > > > > > Hello all, > > > > > > Howdy. > > > > > > > I have a database with JPEGs stored in a blob field and > I want to > > > > display them on an HTML web page with out creating a new > > > file.jpg for > > > > each connection. > > > > > > <snip> > > > > > > > > > Any direction, documentation, script examples, etc. would be > > > > great. > > > > > <snip> > > > use CGI qw(header); > > use DBI; > > my $dbh = ... > > print header('image/jpeg'); > > my($jpegguts) = $dbh->selectrow_array('SELECT jpegguts FROM > > myimg > > WHERE id = 35'); > > print $jpegguts; > > > >HTH > > It's a start, but it gives me the output like: > > Content-Type: image/jpeg and a bunch of garbled-gook :( >
In a browser or via command line? You'll have to put an image tag <img src="myjpg.cgi?id=35"> into html And change the script to take input: use CGI qw(param header); ... my $id = param('id') || 1; $id = 1 unless $id =~ m/^\d+$/; my($jpegguts) = $dbh->selectrow_array("SELECT jpegguts FROM myimg WHERE id = $id); Now if what you're wanting in a way to have html code and then embed the image data into the html code you can use base64 some how I think. If none of those ways work and it's still messup junk then what you have is messed up junk you'll never ghet an image from. HTH Dmuey > Cheers. > > Scott. > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]