laravel-zipstream
laravel-zipstream copied to clipboard
store zip file to s3 only without streaming
hi, understand the purpose of this package is to stream zip files. However, I am not able to find an alternative package.
Is it possible to only store the zip file to s3 without downloading it right away?
$zip = Zip::create($filename)->setPath($path);
foreach($files as $file)
{
$zip->add(
File::make($file->{ContentVersion::CUSTOM_FIELD_URL},$file->{ContentVersion::FIELD_PATHONCLIENT})
->setFilesize($file->{ContentVersion::FIELD_CONTENTSIZE})
);
}
$zip->saveToDisk('s3', $path);
I can save the zip to s3 but it forced me to download it as well.
Hmm, that should be possible. I'll look into it.
@jszobody any updates on that?
I am looking the same solutions. have you solved yet @marcorieser ?
I am looking the same solutions. have you solved yet @marcorieser ?
I just created a temp disk, stuffed all in there and then used PHPs regular ZipArchive functionality to pack that folder. Different approach.
v5.6 takes care of this now folks. The underlying zipstream package automatically sends HTTP headers, so I had to suppress those in order to save a zip to disk without triggering a download. Let me know if you still hit any issues with it.