0

I need to create a zip file with PHP, but the source files are in database rather than stored on disk. Actually, file contents I want to pack are stored as binary in one database, and metas in another.

I have read the docs of class ZipArchive, but it seems that it could only pack files from disk (because file_names are required). I don't want to save files from database to disk, and then pack them, because it may slow down my application. Any other suggestions?

2
  • Please see this function: php.net/manual/en/function.ziparchive-addfromstring.php Commented Dec 9, 2011 at 9:32
  • thanks, I ignored this method because I thought it is not binary safe for its name containing "string". Solved! Commented Dec 9, 2011 at 9:38

1 Answer 1

1

Have you tried ZipArchive::addFromString?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.