PW is the web's leading resource for everything about open APIs and mashups. Learn more: take a tour »
| 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 | Thanks for the heads-up Logan. We've updated this profile. |





©ProgrammableWeb.com 2013. All rights reserved.
Terms of Service | Privacy Policy