title: Create zip archive and stream it to ftp server
body: <p>I am trying to create a zip file from local files and stream it directly to an ftp (without writing the zip to disk first). I have no problems with zipping itself but it seems like the ZipArchive class doesn't recognize the ftp stream wrapper.</p>
  
  <p>The following code is the simplest thing I could come up with that will illustrate the problem</p>
  
  <pre><code>&lt;?php
  
  $zip = new ZipArchive();
  var_dump($zip-&gt;open('ftp://[username]:[password]@[hostname.net]/public_html/test.zip', ZipArchive::OVERWRITE));
  
  $zip-&gt;addFile(realpath('/input.txt'), 'input.txt');
  
  var_dump($zip-&gt;close());
  </code></pre>
  
  <p>The <code>$zip-&gt;open</code> call returns <code>true</code> while <code>$zip-&gt;close</code> returns <code>false</code>. I can't find a way to get an error message or something that can be more specific than just <code>there is an error</code>. The question is what am I doing wrong, or I can't do these kind of stuff with the ZipArchive class.</p>