title: How do I preserve folder structure when using Google Apps Script utilities.unzip()
body: <p>How do I preserve folder structure when using utilities.unzip() in a Google Apps Script?</p>
  
  <p>This is what I am currently using:</p>
  
  <pre><code>    var files  = Utilities.unzip(zipFile);
  
      for (var i=0; i&lt;files.length; i++) {
        folder.createFile(files[i]);      
      }
  </code></pre>
  
  <p>However, it is creating the files with their full zipped path, as their name, flat in the main folder, rather then extracting the files into expected sub-folders.</p>