Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Net::FTP resume download

by Anonymous Monk
on May 04, 2006 at 15:25 UTC ( [id://547435]=perlquestion: print w/replies, xml ) Need Help??

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

Hello Monks

I am trying to write an FTP downloader that can resume the download after 20 seconds (or so) of inactivity. I have got Net::FTP installed and downloading, just not resuming after a stalled download.
I haven't a clue how to implement this. Google didn't help much, this seems like a common enough task though that it should have... can anyone point me in the right direction?

Thanks a bunch!

Replies are listed 'Best First'.
Re: Net::FTP resume download
by Xaositect (Friar) on May 04, 2006 at 15:42 UTC

    If you're just looking for a way to resume a failed transfer, and you know how many bytes you got before it failed, the "get" method supports an offset.

    $ftp->get("that.file", "this.file", $bytes_already_downloaded);
    You could also try Net::FTP::AutoReconnect, which appears to do something similar to what you want.

    Xaositect - Whitepages.com
      Net::FTP::AutoReconnect is nice for hiding some of the intricacies of the FTP session, and it will handle reconnecting and re-establuishment of the environment, but it does not implement a 'resume interupted download' facility. That you will need to write for yourself!

      jdtoronto

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-19 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found