OneDrive公用文件夹问题 [英] OneDrive Public Folder Question

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

问题描述

大家好,

我有一个使用Live SDK v5.6的WinRT C#应用程序。 在我的应用中,用户可以在其OneDrive帐户中上传文件和创建文件夹,并生成共享链接。 无论如何,用户是否能够访问OneDrive上另一个用户指定的
公用文件夹中的文件? 

I have a WinRT C# app that uses the Live SDK v5.6.  In my app a user can upload files and create folders within their OneDrive account and generate share links.  Is there anyway for a user to be able to access files located in another user's specified public folder on OneDrive? 

这是我到目前为止所做的:用户创建一个文件夹并将其设置为公开。 该应用会创建一个"联系卡"文件,用户可以将该文件发送给其他用户。 在此文件中,存储发件人的ID以及指向其公用文件夹的Web链接以及
该文件夹的OneDrive ID。 收件人在我的应用中打开"联系卡"文件,所有值都成功通过。 现在我只需要知道如何(或者如果)我可以使用这些值来指导我的应用程序下载发件人的
公共OneDrive文件夹中的文件列表。 当我尝试使用文件夹ID时:

Here's what I've got so far: A user creates a folder and sets it to public.  The app creates a 'contact card' file that the user can send to another user.  In this file the sender's ID is stored, along with the web link to their public folder and that folder's OneDrive ID.  The recipient opens the 'contact card' file in my app and all the values come through successfully.  Now I just need to know how (or if) I can use those values to direct my app to download a list of files in the sender's public OneDrive folder.  When I try to use the folder ID like so:

LiveOperationResult Aresult = await connectClient.GetAsync(folderID + "/files");

操作永远不会完成。 我认为这是因为folderID与发件人的用户帐户绑定。 那么我的选择是什么?是否还有其他可行的值,例如upload_location? 我可以使用REST API和公共
网站链接来获取文件列表吗? 用户是否可以通过其他方式访问OneDrive上的其他用户的公用文件夹? 谢谢你的帮助。

The operation never completes.  I assume this is because the folderID is tied to the sender's user account.  So what are my options here? Is there another value that would work, like upload_location?  Could I use the REST API and the public web link to get the list of files?  Is there any other way one user can access another user's public folder on OneDrive?  Thanks for your help.

推荐答案

好的我想我解决了。我需要在登录过程中指定范围wl.contacts_skydrive,并确保该文件夹与该特定联系人共享。 不幸的是,似乎我只能以编程方式生成共享链接,这不会让收件人在我的应用程序中查看文件。 因此,我希望用户接收的文件夹需要设置为公开或已经与联系人共享。 有没有办法以编程方式执行此操作?
OK I think I solved it. I needed to specify the scope wl.contacts_skydrive in the sign in process, and make sure the folder is shared with that particular contact.  unfortunately, it seems I can only generate share links programmatically, which does not allow the recipient to view the files in my app.  So either the folder I want the user to receive needs to be set to public or already shared with the contact.  Is there a way to do this programmatically?


这篇关于OneDrive公用文件夹问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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