#!/usr/bin/perl -- use File::Copy; use CGI qw( header ); my $file = "/var/www/cgi-bin/PTF//WP_20140410_19_01_49_Pro.jpg"; print header( -type => q{image/jpeg} , -nph => 1, -Content_length => -s $file ); copy $file, \*STDOUT;