title: Extract a whole directory with zipArchive
body: <p>I have a zip file with the following structure to extract with Php.</p>
  
  <pre><code>-/
   |- db_data.ini
   |- upload/
            |- aa/
                 |- Many files here
            |- bb/
                 |- Many files here
            |- cc/
                 |- Many files here
            |- ETC.
  </code></pre>
  
  <p>In the <code>upload</code> folder there are many other folders containing a big quantity of files.
  What I need is to extract the <code>upload</code> directory to my website <code>upload</code> directory.</p>
  
  <p>The code I'm using for that is the following:</p>
  
  <pre><code>$zip = new ZipArchive();
  if ($zip-&gt;open($input_filename) !== TRUE) throw new Exception('Could not open the zip file !');
  $zip-&gt;extractTo('/upload/', '/upload/');
  $zip-&gt;close();
  </code></pre>
  
  <p>I've chmod(ed) the directory to 0777 but it keeps throwing me a <code>Permission denied</code> on the <code>extractTo</code> line.</p>
  
  <p>Did I make something wrong or did I miss the usage of <code>extractTo</code> ?</p>
  
  <p>Thanks for your help</p>