aniammu has asked for the wisdom of the Perl Monks concerning the following question:
I am new to Perl and CGI program.
I would like to display an image using CGI program.
My code is as below
# cat image
#!/usr/bin/perl
use File::Copy;
print "Content-type: image/jpeg\n\n";
copy "/var/www/cgi-bin/PTF//WP_20140410_19_01_49_Pro.jpg", \*STDOUT;
#
I am getting below error in httpd logs[Tue Apr 29 14:15:09 2014] [error] [client 10.142.236.15] malformed header from script. Bad header=\xff\xd8\xff\xe1\xa7\xdcExif: image1
Please help me to resolve this issue
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Not able to display an image in perl CGI
by Corion (Patriarch) on Apr 29, 2014 at 09:39 UTC | |
by aniammu (Novice) on Apr 29, 2014 at 09:45 UTC | |
by Anonymous Monk on Apr 29, 2014 at 09:49 UTC | |
by aniammu (Novice) on Apr 29, 2014 at 09:56 UTC | |
by poj (Abbot) on Apr 29, 2014 at 11:37 UTC | |
| |
by Anonymous Monk on Apr 29, 2014 at 10:02 UTC | |
| |
by sn1987a (Curate) on Apr 29, 2014 at 12:23 UTC | |
| |
by Discipulus (Canon) on Apr 29, 2014 at 10:27 UTC | |
|