title: read zip archive from php://
body: <p>I receive large object from webservice (WSDL). One of their position is fileContent of zip stored as base64 string. I need to read filename and content from this zip.</p>
  
  <p>I wrote this:</p>
  
  <pre><code>$ePackageFile = $ePackage-&gt;ePackageFile;
  $attachment = $this-&gt;mapper-&gt;mapEPackageFileData((array)$ePackageFile, false);
  
  $limitMBs = 20 * 1024 * 1024;//20MB LIMIT !
  $fp = fopen("php://temp/maxmemory:$limitMBs", 'r+');
  
  fwrite($fp, base64_decode($attachment['attachment_fileContent']));
  
  $zip = new ZipArchive;
  $handler = $zip-&gt;open("php://temp");
  if($handler === FALSE)
      return array('status'=&gt;false, 'result'=&gt;'failed to get stream');
  
  $i=0;
  $out = array();
  while (($file = $zip-&gt;getNameIndex($i)) &amp;&amp; $file !== false) {
      $out[] = array('filename' =&gt; $zip-&gt;getNameIndex($i), 'content' =&gt; $zip-&gt;getFromIndex($i));
      $i++;
  }
  $zip-&gt;close();
  </code></pre>
  
  <p>But I still have "Warning: ZipArchive::getNameIndex(): Invalid or unitialized Zip object ... "</p>
  
  <p>I also checked file using:</p>
  
  <pre><code>$fp = fopen('test.zip','a+');
  fwrite($fp, base64_decode($attachment['attachment_fileContent']));
  fclose($fp);
  </code></pre>
  
  <p>And then extract it using KEKA (successful).</p>
  
  <p>Could you help me with read content using wrapper?</p>
  
  <p>Edit:
  I receive error code 11 (can't open file).</p>