Welcome Guest.
Not a member yet? Why not sign up today and start posting on our forums.
Can I capture a ZipArchive stream
#1

Can I capture a ZipArchive stream

Bit of a cross-post to /r/aws. I have a function that uses the ZipArchive object to create a zipped directory on the fly. Unfortunately, when first implemented it was built to first create the zip in the /tmp directory, then put it in S3. The issue is when the archive fails, it rapidly fills up the /tmp directory then crashes our server.

I'd like to use the current ZipArchive to create the zip (a lot of view/logic mixed in I'd rather not have to peel apart), and to stream it directly to s3.

I've been reading about stream wrappers and filters, which seem like the right tool, but the ZipArchive only allows Streams read-only.

https://www.php.net/manual/en/class.ziparchive.php

submitted by /u/claytron79
[link] [comments]
Reply