in reply to Displaying image to IE problem

Indomitus wrote:

My problem is that when I run the script in Internet Explorer, it tries to download the script and then when the script runs it tries to download the image.

I'm not sure I follow you. When using valid URL and you point your browser to a CGI, if the browser tries to download the script, this typically means that the Web server is not configured properly. In otherwords, it tries to send the script to the browser instead of executing it.

What I read in your post is that the Web server is sending the script and also executing it?

When I run the script in Mozilla or Netscape 4.7, it works fine, displaying the image in the browser with no problems.

Now I'm even more confused. You have specified in your header that the content disposition is "attachment". This means that you should be prompted with a download dialog box. This shouldn't be automatically displaying.

Side note:

while( <IMG>) { print; };

print takes a list (with an optional FH in front of it). Thus, you can do the following, which I think is cleaner:

print <IMG>;

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.