mkahn has asked for the wisdom of the Perl Monks concerning the following question:

Wise monks, I'm parsing the urls of images from a page, and reusing it. The html I'm generating is fine, and the link is coming out the way I expect. If I copy and paste the source of the html my perl script generates, the page renders exactly as I expect. However, calling the script directly from the browser does not display the image.

Why?

One more clue, after I have loaded the images via creating the page as a .html doc locally, the script then loads the images correctly. Do I need to write the output to a file and redirect?

Replies are listed 'Best First'.
Re: CGI, image loading
by robartes (Priest) on Dec 03, 2002 at 07:55 UTC
    Check whether your script sends a Content-Type header. Any self respecting browser will not treat HTML that does not have text/html as content as in fact being HTML. You should be printing something like:
    print "Content-Type: text/html\n\n";
    Also note that it is better to use CGI or die; :).

    CU
    Robartes-

      That's a learned that learned very early, but thanks for the reply. I have also tried using cgi, and not; no difference
Re: CGI, image loading
by dingus (Friar) on Dec 03, 2002 at 10:12 UTC
    Do you perhaps fail to make your URLs absolute URLs?

    If you show us your display code we may be able to see any obvious bugs.

    Dingus


    Enter any 47-digit prime number to continue.