php - Creating ZIP archive on fly from PHPExcel Objects -


i'm developing small api in php , need create zip archive on fly contents (files) created on fly phpexcel library, know how it?

it seems can this:

<?php $zip = new ziparchive; $res = $zip->open('test.zip', ziparchive::create); if ($res === true) {   $zip->addfromstring('test.txt', 'file content goes here');   $zip->close();   echo 'ok'; } else {   echo 'failed'; } ?> 

so have content phpexcel in string use addfromstring method.

for more information have here: http://php.net/manual/en/ziparchive.addfromstring.php


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -