Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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
Replies are listed 'Best First'.
Re: CGI Image Pusher
by merlyn (Sage) on Feb 07, 2002 at 17:06 UTC
Re: CGI Image Pusher
by Anonymous Monk on Dec 25, 2011 at 02:40 UTC

    For good measure, binmode STDOUT and IMAGE

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

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 about the Monastery: (19)
As of 2015-07-07 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls