osx - PHP ZipArchive zip files won't open in Mac OS -
possible duplicate:
dynamically created zip files zipstream in php won't open in osx
i'm using php ziparchive allow website users combine few files zip file, , download them. works on fedora linux computer i'm running on. if download files using mac laptop files not unzip, double clicking creates cpgz file. double clicking cpgz file creates cpgz, etc etc.
going google search zip-cpgz loop looks pretty common problem, solutions suggest original file poorly formatted; zip of non-existant initial file, zip produced windows machine different file ending, things that. don't think that's case mine because works fine on linux machine.
opening zip file in terminal using unzip works, though gives warning
warning [filename.zip]: 3 bytes @ beginning or within zipfile (attempting process anyway)
i prefer not tell users use terminal though, if can avoid it.
here's link 1 of files, can't provide link website i'm operating, it's not , running yet. file should contain 8 ascii files (they're surface temperatures site on surface of mars).
http://eddybarratt.co.uk/wp-content/uploads/2012/06/files_run0000008.zip
an alternative using php's ziparchive class, may provide better results, pcl zip library. use in custom-built cms fallback when php's ziparchive isn't available on user's hosting account. here's example of how we're using it:
if ( class_exists('ziparchive') ) { ... zip files php ziparchive class... } else { require_once('pclzip.lib.php'); $pclzip = new pclzip($destination); $pclzip->create($files, pclzip_opt_remove_all_path); return file_exists($destination); } i realize doesn't answer question of why zip files created ziparchive getting messed up, provides way things working you.
Comments
Post a Comment