ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-web
perl-win32-web
Re: displaying pictures using Perl CGI, apache and Windows
by Bill Luebkert other posts by this author
May 21 2007 4:12PM messages near this date
view in the new Beta List Site
displaying pictures using Perl CGI, apache and Windows | Re: displaying pictures using Perl CGI, apache and Windows
Dhivya Arasappan/O/VCU wrote:
>  Hi all,
>  
>   
>  
>  I have a local web server set up on a windows machine with Apache. I'm 
>  using Perl cgi script to create a web interface. Everything is working 
>  well, except that images are not getting displayed on the website. The 
>  images along with the perl code are in the cgi-bin directory of apache- 
>  I dont know why there's a problem only with the images.
>  
>   
>  
>  Here's the set of header lines, followed by the line of code that 
>  displays the image:
>  
>   
>  
>  /use CGI qw(:standard);/
>  
>  /use CGI;/
>  
>  /use Shell qw(echo wget);/
>  
>  /use CGI::Carp qw( fatalsToBrowser carpout);/
>  
>  /my $query = new CGI;/
>  
>  /print $query->header();/
>  
>  ........
>  
>  /print "<center><img src = 
>  'hrabargraph2.gif'></img></center><p><p><p><p>"; /
>  
>  The hrabargraph.gif is already in cgi-bin folder. Usually with Linux, 
>  such things happen because of permissions. What could be the reason in 
>  Windows? Is it the perl code or could it be some kind of apache 
>  configuration?

You need to add /cgi-bin to the path:

print <<EOD;
<center> <img src="/cgi-bin/hrabargraph2.gif"></img></center>
...
EOD

or as previously suggested, create the images in their own dir (eg: /gif or
/images or /whatever):

print <<EOD;
<center> <img src="/gif/hrabargraph2.gif"></img></center>
...
EOD
_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Dhivya Arasappan/O/VCU
Bill Luebkert
Mark Pryor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved