title: PHP iDisk\Webdav Client
body: <p>I need to upload files to iDisk drive. I've found that iDisk has webdav interface, and it's working fine with desktop clients. Unfortunately I wasn't able to find suitable WebDav client for PHP, and can't find out how to use cUrl to upload files to WebDav. The only <a href="http://www.phpclasses.org/package/1402-PHP-WebDAV-client-to-access-files-in-a-HTTP-server.html" rel="noreferrer">client class</a> I've found doesn't run on my hosting (we are using shared GoDaddy hosting). </p>
  
  <p>Can anyone tell me how can I upload files to WebDav\iDisk Server with PHP?</p>
  
  <p>thanks in advance,
  Michael</p>
  
  <hr/>
  
  <p><strong>UPD</strong></p>
  
  <p>For those, who is searching for answer, here is a code snippet:</p>
  
  <pre><code>include("PEAR/HTTP/WebDAV/Client.php");
  $client = new HTTP_WebDAV_Client_Stream();
  
  $user="YOUR_LOGIN";
  $pass = "YOUR_PASSWORD";
  
  $dir = "webdav://".$user.":".$pass."@idisk.me.com/".$user."/";
  
  $path = "";
  var_dump($client-&gt;stream_open($dir."test.txt","w",null,$path));
  $client-&gt;stream_write("HELLO WORLD!");
  $client-&gt;stream_close();
  $client-&gt;dir_opendir($dir,array());
  var_dump($client-&gt;dirfiles);
  </code></pre>