I'm newbie with OneDrive API and using Microsoft OneDrive file picker for one web-app using javascript and while using WL.init(), it asks for Client_Id and Redirect_UI. I've created Client_Id using Live SDK app management site and added Redirect_UI as 'http://www.onedrivefilepicker.com/callback.aspx'; where 'onedrivefilepicker' is name of my application and callback.aspx is just a blank page created. But, while running the website, it shows error "The server at www.onedrivefilepicker.com can't be found, because the DNS lookup failed. " I understand this error, but don't know how to set redirect_uri and callback page. Please guide me.
Dipti
[EDITED] Code is as follows:
I'm posting my code as follows:
WL.init({client_id: "00000000XXXXXXXX",
redirect_uri:"http://www.OneDriveFilePicker.com/Callback.aspx",
});
function uploadFile_fileDialog() {
WL.fileDialog({mode: "save" }).then(
function (response) {
WL.upload({
path: response.data.folders[0].id,
element: "file",
overwrite: "rename"
}).then(
function (response) {document.getElementById("info").innerText = "File uploaded.";
},
function (responseFailed) {document.getElementById("info").innerText =
"Error uploading file: " + responseFailed.error.message;
} ); },
function (responseFailed) {
document.getElementById("info").innerText =
"Error getting folder info: " + responseFailed.error.message;
}
);
}
Following is the HTML:
<button onclick="uploadFile_fileDialog()">Save file with OneDrive file picker</button>
<label id="info"></label>