uploaddownloadonedrivelive-sdk

How to dowload/upload file to onedrive


I have dynamic xml maker program, it downloads some data on some sites and creates an xml file, then saves it in a debug folder. Now I need upload this xml file to my OneDrive, and I will make a Windows Phone 8 app for downloading this xml file.

I've been looking at microsoft.com and stackoverflow posts, but I can't understand how to upload/download file without user interaction (like ftp upload/download). My desktop app needs to automatically (2 times a day) refresh the xml file. I'm looking for ftp hosts and other host platforms, but their bandwidth is not enough (this file is 4mb and has an estimated daily download 3000 times: 400gb bw/month), and they limit the maximum number of simultaneous users to 200.

(I already have a client id/client pass from https://account.live.com/developers/applications/appsettings/ )


Solution

  • The LiveSDK only needs to pop the user dialog to the user for the first time authentication/authorization, as long as you request the scope wl.offline_access you'll be able to refresh the auth token without popping another dialog that requires user interaction.