sailing
sailing

Reputation: 455

PHP: How to construct zip file from database (or binary file content)?

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?

Upvotes: 0

Views: 2137

Answers (1)

xdazz
xdazz

Reputation: 160833

Have you tried ZipArchive::addFromString?

Upvotes: 1

Related Questions