Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: LWP to download images, how to let LWP decide, wether it is an image or not?

by oneiros (Scribe)
on Oct 20, 2001 at 08:17 UTC ( [id://120208]=note: print w/replies, xml ) Need Help??


in reply to LWP to download images, how to let LWP decide, wether it is an image or not?

hihi.

I haven't tested this yet myself, but since HTTP::Response is a subclass of HTTP::Message, you should be able to:

if ($res->content_type =~ /^image\//) { ...
  • Comment on Re: LWP to download images, how to let LWP decide, wether it is an image or not?
  • Download Code

Replies are listed 'Best First'.
Re: Re: LWP to download images, how to let LWP decide, wether it is an image or not?
by khippy (Scribe) on Oct 20, 2001 at 15:13 UTC
    :-) oneiros, you won the combat :-)
    Since I wanted to avoid an extension test for all possible image file types your knowledge about the LWP-Module and its subclasses fits perfectly. A quick test after implementing the code resulted fine.
    I have updated my scratchpad, if you want to take a look, feel free to do so (and all others, too). Note, that the code is not cleaned up, yet. It's developing code :-)

    --

    there are no silly questions
    killerhippy
Re: Re: LWP to download images, how to let LWP decide, wether it is an image or not?
by Amoe (Friar) on Oct 20, 2001 at 15:09 UTC
    I have tested that, and it is probably the best way to do it.

    --
    my one true love

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-17 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found