Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: showing an image downloaded with LWP::Simple

by RobPayne (Chaplain)
on Sep 09, 2006 at 14:33 UTC ( #572150=note: print w/ replies, xml ) Need Help??


in reply to Re^4: showing an image downloaded with LWP::Simple
in thread showing an image downloaded with LWP::Simple

You haven't told the browser that there is an image coming. The only MIME type that you have given is "text/html", you need to drop all of the html and tell the browser to expect "image/gif". Take a look at the Downloading a file discussion, where there is discussion of headers similar to what you need to set.
Hint: You should take a look at the headers that you get back when you download the image from www.nhc.noaa.gov, and probably hand them back, or directly link to the noaa image from your existing html, like this:

print STDOUT "<html>\n<head>\n"; print STDOUT "<title></title>\n"; print STDOUT "</head>\n"; print STDOUT "<body>\n"; print STDOUT "<img src=\"http://www.nhc.noaa.gov/storm_graphics/AT06/r +efresh/AL0606W5+gif/144631W_sm.gif\"></img>\n"; print STDOUT "</body>\n"; print STDOUT "</html>\n";
Update: see the responses, above, from Joost and Melly.


Comment on Re^5: showing an image downloaded with LWP::Simple
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-11-27 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (186 votes), past polls