[UWP] OneDrive文件上传 [英] [UWP] OneDrive file upload
问题描述
我正在尝试在OneDrive中上传文件 https://msdn.microsoft.com/en-us/magazine/mt632271.aspx
授权总是很好,但是当我尝试上传文件时,我有:
抛出异常:System中的'System.UriFormatException'。 Private.Uri.dll
Hello Suxoi Korm,
我使用以下代码来测试,没有问题:
await ApplicationData.Current.LocalFolder.CreateFileAsync(" Reminders.json");
var dataUri = new Uri(" ms-appdata:///local/Reminders.json");
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);我不确定这个问题是否与OneDrive SDK有关。
请尝试使用以下代码获取json文件以查看它是否可行。
StorageFile _file = await ApplicationData.Current.LocalFolder.GetFileAsync ("Reminders.json");最好的问候,
Xavier Eoro
I'm trying this to upload file in OneDrive https://msdn.microsoft.com/en-us/magazine/mt632271.aspx
With the authorization always good, but when I try to upload file I have:
Exception thrown: 'System.UriFormatException' in System.Private.Uri.dll
Hello Suxoi Korm,
I used the following code to test, there’re no problems:
await ApplicationData.Current.LocalFolder.CreateFileAsync("Reminders.json"); var dataUri = new Uri("ms-appdata:///local/Reminders.json"); StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);I’m not sure if this issue was related to OneDrive SDK.
Please try to use the following code to get your json file to see if it will work.
StorageFile _file = await ApplicationData.Current.LocalFolder.GetFileAsync("Reminders.json");Best Regards,
Xavier Eoro
这篇关于[UWP] OneDrive文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!