You miss-understand. The file is assembled in chunks to avoid large memory load. When it is ready, it is streamed to the client.
It is NOT downloaded in chunks.
Most browsers will show a download progress indicator without you doing anything.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I'm using rap2hpoutre/fast-excel, and when I use the generator method (chunks) to download large files, the browser doesn't show the final file size and estimated time left. (source: https://github.com/rap2hpoutre/fast-excel?tab=readme-ov-file#export-large-collections-with-chunk)
I assume it's by design because the browser can't tell the size as it's being downloaded by chunks? But is there a way to perhaps make the browser know this information?
I just want the users to see the information in the browser.
Because instead of this:
my-large-excel.xlsx
5.5/200 MB ● 2 minutes left
It shows something like this:
my-large-excel.xlsx
5.5 MB downloaded
This is how I'm using it:
// in some controller
public function download()
{
$data = SomeQuery();
return (new FastExcel($this->fast_excel_generator($data)))->download('filename.xlsx');
}
public function fast_excel_generator($data)
{
foreach ($data->cursor() as $row) {
yield $row;
}
}
Thanks
Please or to participate in this conversation.