Test 01simple.xlsx can not be opened

Topics: Developer Forum, User Forum
Oct 19, 2010 at 4:38 PM
Edited Oct 19, 2010 at 4:42 PM

Hello.

I am using PHP Excel 1.7.4. / PHP 5.3.3. and I want to try the file "01simple-download-xlsx.php" in the Tests directory. After downloading the file can not be opened with Excel for Mac 2008 nor Excel 2007 Windows. It tells me that the file is not vaild.

What's wrong here with this example? The other test files with xls and pdf works.

Best Regards.

Coordinator
Oct 22, 2010 at 9:00 AM
Edited Oct 22, 2010 at 10:48 AM

If you're generating the file on a Windows server, there have been some problems with a buggy php_zip.dll that can corrupt the zips that it writes (and Excel2007 is the only writer that needs ZipArchives). Potential solutions are to track down a copy of php_zip.dll that doesn't have this bug (not so easy since pecl4win disappeared) though Pierre's archive on php.net should have a working copy;  or to switch to using an alternative. Some users have reported that a zip wrapper can be used instead (can't find a reference to it though) or I've also heard of a zip writer written in pure PHP (again, can't find the reference to hand).