[UWP] OneDrive文件上传 [英] [UWP] OneDrive file upload

查看:127
本文介绍了[UWP] OneDrive文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆