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

  • Home
  • SEARCH
  • 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 6125777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:17:13+00:00 2026-05-23T16:17:13+00:00

My PHP script is outputting the contents of a .sql file, after it has

  • 0

My PHP script is outputting the contents of a .sql file, after it has been called by a POST request from my Delphi Desktop Client.

Here is what is happening:

  1. My Desktop Client sends a POST request to my PHP Script.
  2. The Script then calls mysqldump and generates a file – xdb_backup.sql
  3. The Script then include "xdb_backup.sql"; which will print and return it to the Desktop Client, whereafter it deletes the SQL file.

The problem is, that the size of the SQL file can vary (for testing, I generated one that is 6 mb). I would like my desktop client to be able to show the progress, however the PHP script does not expose it’s size, so I have no Progressbar.Max value to assign.

How can I make my PHP script let the Client know how big it is before the whole thing is over ?

Note: Downloading the SQL file is not an option, as the script has to destroy it. 🙂

  • 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-05-23T16:17:14+00:00Added an answer on May 23, 2026 at 4:17 pm

    You would do

    $fsize = filesize($file_path); 
    

    where $file_path will be path to the generated file xdb_backup.sql,

    to get the filesize in server and return headers with the following line attached.

    header("Content-Length: " . $fsize);
    

    Take a look at http://www.hotscripts.com/forums/php/47774-download-script-not-sending-file-size-header-corrupt-files-since-using-remote-file-server.html which explains a download php script.

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

Sidebar

Related Questions

A php script is giving this array (which has been passed through json_encode() )
I have a PHP script that needs to determine if it's been executed via
I've got a PHP script which I'm running from a command line (windows) that
My PHP script that uploads a file, cannot do so in directories at a
I am using linux cpanel shared hosting. Am using http://aaa.com/script.php to scrape data from
my php script has $_SERVER['HTTP_HOST'] is equals to an ip that has nothing to
My php script downloads files from a remote server using cURL. I wanted to
I have a PHP CLI script, that processes a csv file, inserting it's content
I have a php script that reads one file through http(the file is on
I have a PHP script which changes file permissions on my server using chmod.

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.