Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php-zip with AWS S3 #51

Open
ghost opened this issue Apr 22, 2020 · 6 comments
Open

php-zip with AWS S3 #51

ghost opened this issue Apr 22, 2020 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 22, 2020

Hi,

i have php-zip working well locally, but will have the need to put my files in AWS S3 storage. I tried to zip a file but it failed...

is the library compatible with AWS S3 ?. The framwwork i'm supports S3 and all files are saved and retrieved successfully.

here's a a sample error:

Fatal error: Uncaught PhpZip\Exception\InvalidArgumentException: File s3://aami-ca-2/uploads/XXXX/YYYY/filename_Package.zip.temp5ea035e27cb4f4.89630193 can not open from write. in X:\vendor\nelexa\zip\src\ZipFile.php:1610 Stack trace: #0

any insight appreciated.

@Ne-Lexa
Copy link
Owner

Ne-Lexa commented Apr 22, 2020

Hello.

I did not work with AWS S3.
Are you sure you registered their stream wrapper?

@ghost
Copy link
Author

ghost commented Apr 24, 2020

are you saying it should work ?

i have S3 wrapper installed and working

@ghost
Copy link
Author

ghost commented Apr 28, 2020

did some debugging

error occurs in saveAsFile() {}
$tempFilename = s3://BUCKET/uploads/2audit_Apr-28-2020_Package.zip.temp5ea87fcbb09140.99052094

error: $tempfilename can not open from write.

@Ne-Lexa
Copy link
Owner

Ne-Lexa commented May 2, 2020

Try ZipFile::saveAsStream.

@insign
Copy link

insign commented Sep 1, 2020

Not a fix, but better alternative is use https://github.com/thephpleague/flysystem

@qiyinxiaoqiang
Copy link

php:openssl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants