How to add a progress bar when redirecting an Excel5 file to the client's browser

Topics: Developer Forum, Project Management Forum, User Forum
Sep 17, 2012 at 1:41 AM

The PHPExcel Developer Documentation says that:

Caution:

  • Make sure not to include any echo statements or output any other contents than the Excel file. There should be no whitespace before the opening <?php tag and at most one line break after the closing ?> tag (which can also be omitted to avoid problems).
  • Make sure that your script is saved without a BOM (Byte-order mark). (Because this counts as echoing output)
  • Same things apply to all included files

however in my project,the time for creating the PHPExcel spreadsheet is very long,so i need a progress bar indicating the status of the creating work or an alert box or something to show that the boring waiting is normal instead an ugly blank browser loading page which would get the users confused.

Coordinator
Sep 17, 2012 at 10:12 AM

If files take a long time to generate, create the file using a background process. The front-end simply sends a request to process... a cron or pubsub queueing system can actually handle the file building.

Use a front-end (ajax) progress bar that periodically checks if the background script has completed, and provide the actual download.

Sep 18, 2012 at 1:35 AM
MarkBaker wrote:

If files take a long time to generate, create the file using a background process. The front-end simply sends a request to process... a cron or pubsub queueing system can actually handle the file building.

Use a front-end (ajax) progress bar that periodically checks if the background script has completed, and provide the actual download.

thank u very much!!