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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

In reply to FTP transfer progress by diggernz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-16 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found