http://qs321.pair.com?node_id=526331

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

Hi people,
I am using the Net::FTP module to transfer user files from a browser. Here is the subroutine that transfers the file
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(); }
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.
Thanks for any help.