I am trying to upload a text file, myFile.txt, to SkyDrive. Below is the code:
private async void btnUpload_Click( object sender, System.Windows.RoutedEventArgs e )
{
Client = new LiveConnectClient( _session );
string filename = "myFile.txt";
var isolatedstorageFile= await ApplicationData.Current.LocalFolder.CreateFileAsync( filename, CreationCollisionOption.ReplaceExisting );
using ( StreamWriter writer = new StreamWriter( await isolatedstorageFile.OpenStreamForWriteAsync() ) )
{
// convert to string
var _String = Serialize( "this is a test file" );
await writer.WriteAsync( _String );
}
await Client.BackgroundUploadAsync( FolderID, new Uri( isolatedstorageFile.Path ), OverwriteOption.Overwrite );
}
FolderID is global and has the value of: "folder.17ff6230f5f26b89.17FF6230F5F26B89!1533"
The problem is in defining the second parameter of the BackgroundUploadAsync. How do I solve it, i.e. specify the URI of where "myFile.txt" IsolatedStorage file is?
Thanks,