Place to install images associated with perl script

B

BlinKol

Considering a script that needs a fixed stock of images during its
process and knowing that this stock shouldn't be accessible out of the
script, where would you install these images ?

In my mind, the best would be to upload them in the same directory as
the Perl script himself, but it doesn't work : server-log says that the
image file is not exacutable and that it don't know how to handle it.

Here is a short test script to show what I want to say :

-- BEGIN OF /cgi-bin/test/test.pl SCRIPT --
#!c:/perl/bin/Perl.exe

print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<img src='/cgi-bin/test/test.gif' border=0>";
print "</BODY></HTML>";
exit 0;
-- END OF SCRIPT --

The image doesn't appear in browser and server's error log says :
"script not found or unable to stat: C:/sites/vhosts/dev/cgi-
bin/test/test.gif, referer: http://dev-desk/cgi-bin/test/test.pl"

Also, this test has been ran in Apache/ActivePerl under Windows, whitout
permission concern.

Do you have an idea about this error ? How would you do ?
 
P

Paul Lalli

BlinKol said:
Considering a script that needs a fixed stock of images during its
process and knowing that this stock shouldn't be accessible out of the
script, where would you install these images ?

In my mind, the best would be to upload them in the same directory as
the Perl script himself, but it doesn't work : server-log says that the
image file is not exacutable and that it don't know how to handle it.

Here is a short test script to show what I want to say :

-- BEGIN OF /cgi-bin/test/test.pl SCRIPT --
#!c:/perl/bin/Perl.exe

print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<img src='/cgi-bin/test/test.gif' border=0>";
print "</BODY></HTML>";
exit 0;
-- END OF SCRIPT --

The image doesn't appear in browser and server's error log says :
"script not found or unable to stat: C:/sites/vhosts/dev/cgi-
bin/test/test.gif, referer: http://dev-desk/cgi-bin/test/test.pl"

Also, this test has been ran in Apache/ActivePerl under Windows, whitout
permission concern.

Do you have an idea about this error ? How would you do ?

Your question has nothing to do with Perl. Your question would be
identical regardless of the language used to generate your CGI script.
Your question is about CGI and Web Server configuration.

Allow me to suggest you ask your question in a group devoted to one of
these two topics.
comp.infosystems.www.authoring.cgi for example.

Paul Lalli
 
M

Matt Garrish

BlinKol said:
Considering a script that needs a fixed stock of images during its
process and knowing that this stock shouldn't be accessible out of the
script, where would you install these images ?

In my mind, the best would be to upload them in the same directory as
the Perl script himself, but it doesn't work : server-log says that the
image file is not exacutable and that it don't know how to handle it.

The image doesn't appear in browser and server's error log says :
"script not found or unable to stat: C:/sites/vhosts/dev/cgi-
bin/test/test.gif, referer: http://dev-desk/cgi-bin/test/test.pl"

Also, this test has been ran in Apache/ActivePerl under Windows, whitout
permission concern.

Do you have an idea about this error ? How would you do ?

The error arises because you've put non-executable files in an executable
directory. Please be aware that so long as the images are in a web-readable
directory, they will be viewable by anyone. You may think this is working on
Windows, but I suspect anyone can access the images regardless of whether
they're using your script or not. You may want to consider replacing the
links directly to the images with links to a script that will only stream
the images based on some sort of user validation. This really has nothing to
do with Perl, however, so I would suggest that you take the problem to
comp.infosystems.www.authoring.cgi or some other relevant group if you want
more information.

Matt
 
K

Kevin Luff

BlinKol said:
Considering a script that needs a fixed stock of images during its
process and knowing that this stock shouldn't be accessible out of the
script, where would you install these images ?

In my mind, the best would be to upload them in the same directory as
the Perl script himself, but it doesn't work : server-log says that the
image file is not exacutable and that it don't know how to handle it.

Here is a short test script to show what I want to say :

-- BEGIN OF /cgi-bin/test/test.pl SCRIPT --
#!c:/perl/bin/Perl.exe

print "Content-type: text/html\n\n";
print "<HTML><BODY>";
print "<img src='/cgi-bin/test/test.gif' border=0>";
print "</BODY></HTML>";
exit 0;
-- END OF SCRIPT --

The image doesn't appear in browser and server's error log says :
"script not found or unable to stat: C:/sites/vhosts/dev/cgi-
bin/test/test.gif, referer: http://dev-desk/cgi-bin/test/test.pl"

Also, this test has been ran in Apache/ActivePerl under Windows, whitout
permission concern.

Do you have an idea about this error ? How would you do ?

A quick and dirty fix would be -

assuming you can do http://dev-desk/cgi-bin/test/test.gif in your
browser and get the image - would be to have that URL as the IMG SRC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top