I'm trying to use LiveConnectClient.BackgroundUploadAsync
in wp8, to upload copy of some data.
Her is my code:
var progress = new Progress<LiveOperationProgress>();
progress.ProgressChanged += progress_ProgressChanged;
try
{
LiveOperationResult res =
await liveClient.BackgroundUploadAsync(folderID,
new Uri(@"\shared\transfers\" + backupFile.Name, UriKind.Relative),
OverwriteOption.Overwrite, new System.Threading.CancellationTokenSource().Token, progress);
dynamic result = res.Result;
fileID = result.id;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
progress.ProgressChanged -= progress_ProgressChanged;
}
It's working fine on emulator, but when I tried it on the phone its working only when the phone connected to pc by usb , the phone connected to wifi.