puturrudefoie
New Member
I have an XLSX file which I need to inject some data into. I unzipped the file successfully, I added some data to xl/worksheets/sheet1.xml, and re-zipped it back. I can see the data in the updated file and in the zip but when I opened it in Excel 2007, the excel file is empty.To zip and I unzip it, I have used the ZipArchive class and PclZip library. What am I missing? Why is the data not included in the final excel file? Here is the code to Zip and Unzip using PclZip:\[code\]// Unzip$archive = new PclZip('report.zip');if ($archive->extract() == 0) { die("Error : ".$archive->errorInfo(true));}// Zip$archive2 = new PclZip('xlarchive.zip');$files = "xl/,docProps/,_rels/,[Content_Types].xml";if ($archive2->create($files) == 0) { die('Error : '.$archive2->errorInfo(true));}\[/code\]