Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

How to download a file

by salibas (Initiate)
on Feb 26, 2002 at 12:13 UTC ( #147534=perlquestion: print w/replies, xml ) Need Help??

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

I need a perl script that helps me download MP3 and PDF files from my site without opening it.

Replies are listed 'Best First'.
Re: How to download a file
by projekt21 (Friar) on Feb 26, 2002 at 12:24 UTC

    Have a look at LWP::Simple to start with.

    use LWP::Simple; my $url = "http://www.foo.com/mp3s/foo.mp3"; my $file = "/path/to/local/file/foo.mp3"; getstore($url, $file);
    Plus some error handling and "use strict;" and maybe some more features and you'll be lucky.

    alex pleiner <alex@zeitform.de>
    zeitform Internet Dienste

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2021-04-21 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?