12

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 client class I've found doesn't run on my hosting (we are using shared GoDaddy hosting).

Can anyone tell me how can I upload files to WebDav\iDisk Server with PHP?

thanks in advance, Michael


UPD

For those, who is searching for answer, here is a code snippet:

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->stream_open($dir."test.txt","w",null,$path));
$client->stream_write("HELLO WORLD!");
$client->stream_close();
$client->dir_opendir($dir,array());
var_dump($client->dirfiles);
Mee
  • 458
  • 1
  • 6
  • 21
  • instantiating $client = new HTTP_WebDav_Client_Stream() makes the server answer with a 500 error. I am using Apache2 with php5 have you got the same problem? – fat Nov 30 '11 at 10:46

1 Answers1

7

Maybe you could try the PEAR webdav client?

http://pear.php.net/package/HTTP_WebDAV_Client/

Good luck :)

thecodeassassin
  • 816
  • 10
  • 24
  • Oh, great, thanks a lot. Unfortunately it doesn't have nice docs, so it took a while to understand how it works (and get PEAR installed on shared hosting). For those, who will want to upload files, I'll put a code snippet to my question. – Mee Jul 30 '10 at 09:53