title: ZipArchive zip in linux corrupt in windows
body: <p>I use ziparchive to zip my files in linux, and can't open in windows
  default zip uploader, I suspect it is caused by the file path during addfile
  e.g.  </p>
  
  <pre><code>$zip-addFile(‘/home/userName/public_html/gallery/license.txt’, ‘gallery/license.txt’);
  </code></pre>
  
  <p>Suggestion from links below mention that I coudl remove the local path(as this can't be understood by windows), which becomes becomes</p>
  
  <pre><code>$zip-addFile(‘/home/userName/public_html/gallery/license.txt’, ‘license.txt’);
  </code></pre>
  
  <ol>
  <li><p><a href="http://www.jacobbates.com/blog/2012/04/24/corrupt-zip-files-in-windows-from-phps-ziparchive/" rel="nofollow noreferrer">http://www.jacobbates.com/blog/2012/04/24/corrupt-zip-files-in-windows-from-phps-ziparchive/</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/4620205/php-ziparchive-corrupt-in-windows">PHP ZipArchive Corrupt in Windows</a></p></li>
  </ol>
  
  <p>But I need to maintain the directory structure, how should I address this problem?</p>