stechstudio / laravel-zipstream

Easily create Zip files on-the-fly and provide a streaming download
MIT License
419 stars 60 forks source link

store zip file to s3 only without streaming #117

Open kevinlau-drewberry opened 4 months ago

kevinlau-drewberry commented 4 months ago

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.

jszobody commented 4 months ago

Hmm, that should be possible. I'll look into it.

marcorieser commented 1 month ago

@jszobody any updates on that?

ratxcat commented 1 month ago

I am looking the same solutions. have you solved yet @marcorieser ?

marcorieser commented 1 month ago

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.