title: PHP ZipArchive zip files won't open in Mac OS
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5573211/dynamically-created-zip-files-by-zipstream-in-php-wont-open-in-osx">Dynamically created zip files by ZipStream in PHP won&#39;t open in OSX</a>  </p>
  </blockquote>
  
  
  
  <p>I'm using PHP ZipArchive to allow website users to combine a few files into a zip file, and then download them. It works perfectly on the Fedora linux computer I'm running it on. But if I download the files using my Mac laptop the files will not unzip, double clicking creates a cpgz file. Double clicking the cpgz file creates another cpgz, etc etc.</p>
  
  <p>Going by a google search the zip-cpgz loop looks like it is a pretty common problem, but almost all the solutions suggest that the original file was poorly formatted; a zip of a non-existant initial file, a zip produced by a windows machine with a different file ending, things like that. I don't think that's the case with mine because it works fine on my Linux machine.</p>
  
  <p>Opening the zip file in the terminal using unzip works, though gives the warning </p>
  
  <blockquote>
    <p>warning [filename.zip]:  3 extra bytes at beginning or within zipfile (attempting to process anyway)</p>
  </blockquote>
  
  <p>I would prefer not to tell users to use the terminal though, if I can avoid it.</p>
  
  <p>Here's a link to one of the files, I can't provide a link to the website I'm operating, it's not up and running yet. The file should contain 8 ascii files (they're surface temperatures for a site on the surface of Mars).</p>
  
  <p><a href="http://eddybarratt.co.uk/wp-content/uploads/2012/06/files_run0000008.zip" rel="nofollow noreferrer">http://eddybarratt.co.uk/wp-content/uploads/2012/06/files_run0000008.zip</a></p>