dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Skydrive application help

  1. #1
    Join Date
    Dec 2013
    Posts
    1

    Skydrive application help

    Hello,

    I need to create a client application that uploads a file or files to Skydrive, but also measures the latency of each file upload. The app must receive as parameter a folder from the skydrive and have the files written sequentially.

    I have the basic code but I have no idea what to do after this. Please help, i'm lost.

    CODE:

    WL.init({ client_id: clientId, redirect_uri: redirectUri });

    WL.login({ "scope": "wl.skydrive_update" }).then(
    function(response) {
    displayDialog();
    registerOnClickHandlers();
    },
    function(response) {
    log("Failed to authenticate.");
    }
    );

    function registerOnClickHandlers() {
    var uploadFileButton =
    document.getElementById('save-to-skydrive-upload-button');
    uploadFileButton.disabled = true;
    uploadFileButton.onclick = function() {
    closeDialog();
    saveToSkyDrive();
    };

    var fileInputElement =
    document.getElementById('save-to-skydrive-file-input');
    fileInputElement.onchange = function() {
    uploadFileButton.disabled = (fileInputElement.value === "");
    };
    }

    function saveToSkyDrive() {
    WL.fileDialog({ mode: 'save' }).then(
    function(response) {
    var folder = response.data.folders[0];

    WL.upload({
    path: folder.id,
    element: 'save-to-skydrive-file-input',
    overwrite: 'rename'
    }).then(
    function(response) {
    log("You saved to " + response.source + ". " +
    "Below is the result of the upload.");
    log("");
    log(JSON.stringify(response));
    },
    function(errorResponse) {
    log("WL.upload errorResponse = " + JSON.stringify(errorResponse));
    },
    function(progress) {
    // progress events for the upload are raised here
    }
    );
    }, function(errorResponse) {
    log("WL.fileDialog errorResponse = " + JSON.stringify(errorResponse));
    }
    );
    }

    function log(message) {
    var child = document.createTextNode(message);
    var parent = document.getElementById('JsOutputDiv') || document.body;
    parent.appendChild(child);
    parent.appendChild(document.createElement("br"));
    }

  2. #2
    Join Date
    Oct 2013
    Posts
    17
    Please note I have not done this but you'll need to write some ASP.NET server side code. Look up LiveConnect and skydrive.

  3. #3
    Join Date
    Oct 2013
    Posts
    17
    I found a link that looks promising for using PHP.

    http://stackoverflow.com/questions/1...-php-and-oauth

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles