file - Get the download and shared link using Onedrive (skydire) API without downloading -
file - Get the download and shared link using Onedrive (skydire) API without downloading -
please, can help me show me how modify script (to pick) download , shared link of file size , mimetype using onedrive api without downloading file (as in function) :
wl.init({ client_id: clientid, redirect_uri: redirecturi }); wl.login({ "scope": "wl.skydrive wl.signin" }).then( function(response) { openfromskydrive(); }, function(response) { log("failed authenticate."); } ); function openfromskydrive() { wl.filedialog({ mode: 'open', select: 'single' }).then( function(response) { log("the next file beingness downloaded:"); log(""); var files = response.data.files; (var = 0; < files.length; i++) { var file = files[i]; log(file.name); wl.download({ "path": file.id + "/content" }); } }, function(errorresponse) { log("wl.filedialog errorresponse = " + json.stringify(errorresponse)); } ); } function log(message) { var kid = document.createtextnode(message); var parent = document.getelementbyid('jsoutputdiv') || document.body; parent.appendchild(child); parent.appendchild(document.createelement("br")); }
the demo link : http://isdk.dev.live.com/dev/isdk/isdk.aspx?category=scenariogroup_skydrive&index=0
thank help.
i see next properties available file variable gets returned picker:
id, description, name, type, link, upload_location, source, photo
via version of openfromskydrive() method:
function openfromskydrive() { wl.filedialog({ mode: 'open', select: 'single' }).then( function(response) { log("the next file beingness downloaded:"); log(""); var files = response.data.files; (var = 0; < files.length; i++) { var file = files[i]; log(file.name); /* show the properties of 'file' variable */ for( var p in file){ log(p); } /* type, isn't total mimetype */ log(file.type); /* share link */ log(file.link); /* not download file */ // wl.download({ "path": file.id + "/content" }); } }, function(errorresponse) { log("wl.filedialog errorresponse = " + json.stringify(errorresponse)); } ); }
file api skydrive picker onedrive
Comments
Post a Comment