Dashboard > Directory > Open Xdrive API Profile

Welcome to ProgrammableWebclose

PW is the web's leading resource for everything about open APIs and mashups.   Learn more: take a tour »

Like storage? PW has:

Open Xdrive Comments

Note: The Open Xdrive API is no longer available.
This profile is retained for historical purposes only.
 Used this? Share your thoughts... Please login to comment.

22 Feb 2008

net says:

You can use simple perl script to upload files to xdrive.
------begin--------
#!/usr/bin/perl

use LWP::UserAgent;
use JSON;
use Data::Dumper;

my $json = JSON->new(pretty => 1, delimiter => 0);
my $ua = LWP::UserAgent->new;

$numArgs = $#ARGV ;
if ($numArgs < 2) {
print "Usage: <program> username password filenamern";
exit -1;
}

$USER=$ARGV[0];
$PASSWD=$ARGV[1];
$FILENAME=$ARGV[2];

$credentials = {"user" => {
"type" => "MemberObject",
"username" => $USER,
"password" => $PASSWD
}};

$json_req = $json->objToJson($credentials);
$url="https://plus.xdrive.com/json/v1.2/member.login?data=$json_req";
$response = $ua->post($url);
$content = $response->content;
$obj = $json->jsonToObj($content);
print Dumper $obj;
$JSESSIONID=$obj->{jsessionid};
$ROOT_DIR=$obj->{results}->{user}->{rootFolderId};


$req = {
"destFolder" => {
"type" => "FileObject",
"id" => $ROOT_DIR },
};
$json_req = $json->objToJson($req);

$url = "http://plus.xdrive.com/json/v1.2/io.formupload;jsessionid=$JSESSIONID?data=$json_req";
$response = $ua->post($url,
'Content_Type' => "multipart/form-data",
'Content' => ['file' => [$FILENAME]],
);
$content = $response->content;

$obj = $json->jsonToObj($content);
print Dumper $obj;

----------end---------

07 Jan 2009

Logan says:

XDrive is shutting down.

07 Jan 2009

jmusser jmusser says:

Thanks for the heads-up Logan. We've updated this profile.
6714 of 11293 APIs

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.