Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8459823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:26:06+00:00 2026-06-10T13:26:06+00:00

I have a working FTP file download script. The files I am downloading will

  • 0

I have a working FTP file download script.
The files I am downloading will be about 2-4 GB per day.
I was wondering if there was a way to get the percent of the file where it’s at?

I have looked on php.net and on here but I couldn’t find any similar questions and rather spend more time looking I figure I would ask people much smarter than myself.

I was thinking about if there was a function to see where it’s at in the download, but I couldn’t find one since ftp_get would have to complete first so that eliminated the chance of flushing the buffer every few seconds to display a new percent.

Anyone?

Here is my code: I hid all of my variables above it.

$conn_id = ftp_connect($ftp_server);

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
    echo "Successfully written to $local_file\n";
} else {
    echo "There was a problem\n";
}

ftp_close($conn_id);

EDIT:

I added ftp_nb_get and here is my code for that. It keeps downloading fine, just doesn’t echo it out to the browser.

$ret = ftp_nb_get($conn_id, $local_file, $server_file, FTP_BINARY, $size);
while ($ret == FTP_MOREDATA) {
  echo round((filesize($local_file)/$server_size)*100)."%\n";
  $ret = ftp_nb_continue($conn_id);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:26:08+00:00Added an answer on June 10, 2026 at 1:26 pm

    Try using the non-blocking version ftp_nb_get() and ftp_nb_continue() in a loop, and check for the saved file’s size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working application that downloads a specific file in the Ftp Server.
I have working registration script the only problem is that i do not know
There are databases on Firebird and SQL Server. I have working stored procedure in
I have xml files been imported onto an FTP server. This is stored in
im working on a content management system for that i have to download a
I am trying to download a file from an FTP server using an NSOperation.
So, I have a script I'm working on to back up large a server('s
I am creating a script on the fly to ftp some files from a
I made a shell script that get a remote file with ftp protocol, if
I have a working FTP system with android, but I want to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.