in reply to Image display problem with CGI script

Greetings all,
Just a quick question. Why are you opening the file in the first place? Since this is a CGI script I would bet you are viewing this script via a web browser in which case you could simply check for the existence of the file, if its there pass the path(url) to the browser else error out.
Just a thought since from looking at your code above you are not really doing anything with the image that requires reading it in binarily (is that a word?).
Of course I have not seen the rest of your code so I could be wrong.
-injunjoel
  • Comment on Re: Image display problem with CGI script

Replies are listed 'Best First'.
Re: Re: Image display problem with CGI script
by Roger (Parson) on Dec 12, 2003 at 20:50 UTC
    Hi injunjoel, that *is* the rest of the code. The images I want to display is stored under local directories, and I don't want to make the files accessible from the Web, I only want to access them via a CGI script, so I can control the access later. I put in the binary mode because the script was not running properly and I wanted to see if that would make any difference.