I am writing a really small cgi in visualc++ that has the only purpose of displaying a gif (or jpeg) file.
I read the file in binary and then I send the "Content-Type: image/gif" header followed by the binary data.
When I run the cgi from Internet Explorer it doesn't display the image correctly. It does display an image but it is way different from the original image (looks like noise).
I wonder if anyone can help me out here. I don't know what the problem is, since the content type header is OK and I think I am reading the file correctly (I write an output file that looks exactly the same as the original file).
I have found perl scripts that do this but I need to do it in visualc++ (windows).