Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

CGI Image Pusher

by pschoonveld (Pilgrim)
on Feb 07, 2002 at 16:26 UTC ( #143908=perlcraft: print w/ replies, xml ) Need Help??

   1: #!/usr/bin/perl
   2: # CGI Animated GIF Pusher
   3: 
   4: # Harkening back to the days before GIF89, I needed one of these
   5: # today. So, I wrote one and it works. But, as it turns out, not
   6: # with the joy that is IE. Netscape, no problem.
   7: 
   8: print "Content-type: multipart/x-mixed;boundary=myboundary\n\n";
   9: print "myboundary\n";
  10: $| = 1;
  11: @images = ('green.gif','blue.gif','red.gif');
  12: foreach $image (@images) {
  13: 	print "Content-Type: image/gif\n\n";
  14: 	open IMAGE,"<$image" or die "bad image, $image";
  15: 	print <IMAGE>;
  16: 	close IMAGE;
  17: 	print "\nmyboundary\n";
  18: 	sleep 2;
  19: }

Comment on CGI Image Pusher
Download Code
Re: CGI Image Pusher
by merlyn (Sage) on Feb 07, 2002 at 17:06 UTC
Re: CGI Image Pusher
by Ryszard (Priest) on Feb 14, 2002 at 04:56 UTC
    Whoops! might want to add the FS response: <code>open IMAGE,"<$image" or die "bad image, ".$image.": ".$!;</code
Re: CGI Image Pusher
by Anonymous Monk on Dec 25, 2011 at 02:40 UTC

    For good measure, binmode STDOUT and IMAGE

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlcraft [id://143908]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-08-29 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls