, 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.