Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Display gif in CGI page

by choroba (Cardinal)
on Dec 08, 2011 at 09:43 UTC ( [id://942382]=note: print w/replies, xml ) Need Help??


in reply to Display gif in CGI page

Is it a picture, or an HTML? If a picture, do not start_html.

Replies are listed 'Best First'.
Re^2: Display gif in CGI page
by PhillipHuang (Beadle) on Dec 08, 2011 at 09:52 UTC
    Thanks, gif displayed when remove 'start_html' lines. CGI manual says'The start_html() routine creates the top of the page, along with a lot of optional information that controls the page's appearance and behavior.This method returns a canned HTML header and the opening <body> tag. '. It seems to have nothing with displaying images, I am still confused why remove it can take effect.

      For the same reason that:

      cat foo.html bar.gif baz.html > quux.gif

      will create a file that is neither valid HTML nor a valid GIF.

      (Interestingly cat bar.gif baz.html > quux.gif does create a valid GIF.)

      Because calling it adds some lines to the output that do not belong to the image. The "image file" thus becomes corrupted and cannot be displayed (or even cannot be recognised as a picture).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://942382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found