Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Serving Images from Databases

by Anonymous Monk
on Apr 29, 2003 at 13:50 UTC ( [id://253949]=note: print w/replies, xml ) Need Help??


in reply to Serving Images from Databases

Thanks so much for this code. Exactly what I was looking for!!

Replies are listed 'Best First'.
Re: Re: Serving Images from Databases
by Ovid (Cardinal) on Apr 29, 2003 at 15:27 UTC

    Glad it's useful, though I have to confess that this code -- almost three years old -- is not something I would write today. Interesting how we evolve, eh?

    Cheers,
    Ovid

    New address of my CGI Course.
    Silence is Evil (feel free to copy and distribute widely - note copyright text)

      Ovid,

      I tried the code that you posted a while ago. I used it on a Win2k server and never had any problem. I switched onto Unix iPlanet and the code does not work anymore. The last line :

      print header(-type => 'image/gif', -Content_length => length $file), $file;

      causes the script to hang and never return... I am not too familiar with iPlanet ... can it be a problem with the web server ?

      Do you have any idea why ?

      ... use CGI qw(header path_info); my $file = getNoImage($SHOP); print header(-type => 'image/gif', -Content_length => length $file), $ +file; sub getNoImage { my $SHOP = shift || croak ("ProcessAction : Missing Shop data"); my ($chunk, $image); open IMAGEFILE, "$SHOP->{-TEMPLATE_PATH}/img/NoImage.gif" or die " +Cannot open $SHOP->{-TEMPLATE_PATH}/img/NoImage.gif: $!\n"; binmode IMAGEFILE; while (read(IMAGEFILE, $chunk, 1024)) { $image .= $chunk; } close IMAGEFILE; return $image; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://253949]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found