cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying images from CGI

ianscales
Grafter
Posts: 75
Registered: 30-07-2007

Displaying images from CGI

Can anybody here shed any light on what's going wrong?
I started a thread on EZScripting as that is the script I'm using please see
http://www.ezscriptingforums.com/forum/index.php?topic=706.0
Ian
7 REPLIES
Community Veteran
Posts: 14,469
Registered: 30-07-2007

Re: Displaying images from CGI

You cannot put images in cgi-bin. Only perl (.pl) and shell scripts can be run / accessed from their, any normal files cannot.
You need to use an directory outside cgi-bin for the images.
ianscales
Grafter
Posts: 75
Registered: 30-07-2007

Re: Displaying images from CGI

Thanks Peter, I thought I'd done that with http://www.rafmtd.plus.com/rafmtd/rafmtd4.jpg, which is the full path in the database  Huh
Or are you saying that because it originates from the CGI that the path won't be recognised, in which case how do I get the script results to appear in an external page?, I've tried putting the full path to an external page but it won't open.
Ian
Community Veteran
Posts: 14,469
Registered: 30-07-2007

Re: Displaying images from CGI

The link you have given does not work - are you sure the URL is correct?
As given, the URL is looking for an image on your www webspace in htdocs\rafmtd\rafmtd. Is that where the image is when viewing via FTP?
Are we talking about images on your ccgi webspace or your www webspace which are actually on different web servers?
ianscales
Grafter
Posts: 75
Registered: 30-07-2007

Re: Displaying images from CGI

Sorry peter, http://www.rafmtd.co.uk/rafmtd4.jpg
But this returns "Can't open file http://www.rafmtd.co.uk/testpage.html!"; when called for from the script, but will open in a browser.
I have been putting copies of the image on both servers and under differant directories including /images/ in the root of CCGI.
I might have to use MySQL instead, I've got a guestbook on another site that's working fine, but I need to be able to search the data on the rafmtd site and initially EZScripting looked like it would be O.K.
Ian
P.S. Edit, having just checked this post the first link only works if you paste into browser !!!
Community Veteran
Posts: 14,469
Registered: 30-07-2007

Re: Displaying images from CGI

Quote from: ianscales
But this returns "Can't open file http://www.rafmtd.co.uk/testpage.html!"; when called for from the script, but will open in a browser.

It depends on what the script is doing with the file or whether the file it is trying to read, is on the same server as the script.
If the html is on your www server space and the script is on your ccgi server space and is assuming the html is on its server (ccgi) then it won't be able to open it.
ianscales
Grafter
Posts: 75
Registered: 30-07-2007

Re: Displaying images from CGI

Thanks for the reply Peter, I'm on a mobile connection at the moment so unable to connect to the CGI server, will take another look on Monday.
Ian
ianscales
Grafter
Posts: 75
Registered: 30-07-2007

Re: Displaying images from CGI

Thanks Peter, amazing what a weekend away does  Smiley cleared my mind, and now it works fine, the image files needed to be in an image directory at the CGI root (I had the directory within the cgi-bin  Roll eyes
Thanks again for your patience.
Ian