diggernz has asked for the wisdom of the Perl Monks concerning the following question:
What i am wanting to do is show a progress bar. I am aware of the need to flush the output buffer. How can I use the 'put' command in a loop that will allow me to display a progress indication to inform the user on the time remaining to transfer. This interface will be used to transfer large files upto 100mb.sub ftpTransfer { # connect my $ftp = Net::FTP -> new($server); print $ftp -> message(), "\n"; # login $ftp -> login("$user","$pass"); print $ftp -> message(), "\n"; # set binary mode $ftp -> binary(); print $ftp -> message(), "\n"; # move through directories # $dir = "ftp"; # $ftp -> cwd($dir); # print $ftp -> message(), "\n"; # list files my @list = $ftp -> ls(); print $ftp -> message(), "\n"; print "<br>Filename: $filename<br>"; # put files on the server $ftp->put($filename, $filename) or die "could not put $file"; print $ftp -> message(), "\n"; $ftp -> quit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FTP transfer progress
by rhesa (Vicar) on Jan 30, 2006 at 01:48 UTC | |
|
Re: FTP transfer progress
by sk (Curate) on Jan 30, 2006 at 01:39 UTC | |
|
Re: FTP transfer progress
by zentara (Cardinal) on Jan 30, 2006 at 12:41 UTC |