You need to get the folder id first. You can do it as follows:
private async Task<string> GetSkyDriveFolderID(string folderName)
{
client = App.LiveClient;
LiveOperationResult operationResult = await client.GetAsync("me/skydrive/files?filter=folders");
var iEnum = operationResult.Result.Values.GetEnumerator();
iEnum.MoveNext();
var folders = iEnum.Current as IEnumerable;
foreach (dynamic v in folders)
{
if (v.name == folderName)
{
return v.id as string;
}
}
return null;
}
Call this method before uploading the file to get the folder id:
string folderId = await GetSkyDriveFolderId("folderName");
LiveOperationResult res = await client.BackgroundUploadAsync(folderId, new Uri("/shared/transfers/" + t, UriKind.Relative), OverwriteOption.Overwrite);