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;
}
}
@Snapey Oh, so do you have an idea why it doesn't show the indicator when I use the generator (chunks) method of Fast-Excel? I'm only using Fast-Excel with the chunks method, so I am not sure if it's only this method that's doing that or all of the Fast-Excel methods, but other packages of excel downloads do not do that because I'm using another package as well for the less-heavy Excel files
Edit: This is how I'm using it (Also added this to the question):
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;
}
}