Re: displaying pictures using Perl CGI, apache and Windows

2007-05-21 Thread mark pryor
Dhivya,

Of course your CGI folder is executable only. Would you want the CGI scripts to 
be displayed as text? No, you want them executed.

The standard practice is to setup an icons or images folder and alias it. Tell 
apache the full path to that folder.

then use
img src = '../images/hrabargraph2.gif'

 httpd.conf snip 
Alias /images/ /var/www/html/images/

Directory /var/www/html/images
#Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
/Directory
- end snip ---
cheers,
Mark
Dhivya Arasappan/O/VCU [EMAIL PROTECTED] 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 centerimg src = 'hrabargraph2.gif'/img/center; 
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?
 
thanks
dhivya
 
___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


 
-
Need Mail bonding?
Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users.___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: displaying pictures using Perl CGI, apache and Windows

2007-05-21 Thread Bill Luebkert
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 centerimg src = 
 'hrabargraph2.gif'/img/center; /
 
 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;
centerimg 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;
centerimg src=/gif/hrabargraph2.gif/img/center
...
EOD
___
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs