Set html header content type : Content Type « CGI « Perl






Set html header content type

    

#!/usr/local/bin/perl

use CGI;

$co = new CGI;

open (COUNT, "<count.dat") 
    or die "Could not open counter data file.";

$count = <COUNT>;

close COUNT;

$image = $count % 10;

open (IMAGE, "<$image.gif");

$size = -s "$image.gif";

read IMAGE, $data, $size;

close IMAGE;

print 

$co->header(-type=>'image/gif'),

$data;

   
    
    
    
  








Related examples in the same category

1.Set content type
2.Explicitly name the content type and status arguments: