Processing won't continue after finishing file download #184
-
I just added ZipStream to my Laravel 8.x project today and it works pretty darned well. However, when it gets finished with downloading the stream, it just hangs there. Only if I manually refresh the page will it continue. Here's my code: $options = new Archive();
$options->setSendHttpHeaders(true);
$options->setEnableZip64(false);
$filepath = 'download.' . date('Y.m.d.h.i.s') . '.zip';
$zip = new ZipStream($filepath, $options);
$count = 0;
foreach ($files as $file) {
$fileName = $file->name;
$content = file_get_contents($file->signedUrl());
$zip->addFile($fileName, $content);
$count++;
}
try {
$zip->finish();
} catch (OverflowException $e) {
flash()->error('Error: A problem occurred with zip streaming.');
return back();
}
flash($count . ' file(s) zipped and downloaded.');
return back();
Thanks in advance for any help you can offer! Mark Pemburn |
Beta Was this translation helpful? Give feedback.
Answered by
NicolasCARPi
Jun 4, 2021
Replies: 1 comment 3 replies
-
Hello, What's |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
maennchen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
What's
back()
?