从网站上传文件到skydrive [英] upload files to skydrive from websites

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

问题描述


我必须将文件从asp.net网站上传到skydrive。我的概念继续这样......

I have to upload files from asp.net site to skydrive. my concept goes on like this...



我的网站将注册到skydrive。在内部我们允许我们的用户将他们的文件存储到skydrive,应该只有一个帐户。但是我们需要根据他们的公司名称和插入文件来区分它们。这可以解决这个问题....

my site will register to skydrive. and internally we allow ours users to store their files to skydrive there should be only one account. but we need to differentiate them based on their company name and insert files.does this work out....



提前致谢...

Thanks in advance...

推荐答案

如果我了解您的方案,您希望使用专用Windows Live ID的SkyDrive帐户? 如果这是正确的,则以下内容应该有效:

If I understand your scenario, you want to use the SkyDrive account of a dedicated Windows Live ID?  If that's correct, the following should work:

(1)获取已授予wl.offline_access范围的专用Windows Live ID的访问令牌和刷新令牌。 一种方法是编写一个在本地计算机上运行的VS.NET Web应用程序。 您编辑主机
文件以将应用程序的重定向URI映射到127.0.0.1。 我相信以下代码示例可以在这里提供帮助:

(1) Get an access token and refresh token for your dedicated Windows Live ID that has been granted the wl.offline_access scope.  One way to do this would be to write a VS.NET web application that you run on your local machine.  You edit your hosts file to map the redirect URI for your application to 127.0.0.1.  I believe the following code sample could help here:

https://github.com/liveservices/LiveSDK/tree/master/Samples/Asp.net/AuthenticationTokenSample

(2) 传递获得的访问令牌(1)在上传用户文件时对API服务的调用。

(2) Pass the access token obtained in (1) in your calls to the API Service when uploading user's files.

就公司/用户之间的区别而言,你必须想出自己的机制 - 也许是为每个公司创建单独的文件夹?

As far as differentiation between companies/users, you would have to come up with your own mechanism for that - perhaps by creating separate folders for each company?

要记住的另一件事是访问令牌只能在一小时内使用,因此您必须继续使用刷新令牌来获取新的需要时访问令牌。 该流程会不断更新您的刷新令牌,因此只要您继续使用
较新的刷新令牌,您的解决方案就可以正常工作(我相信刷新令牌本身就可以使用一年)。上面的github示例在这方面也应该有所帮助。

Another thing to keep in mind is that access tokens are only good for an hour, so you'll have to keep using your refresh token to get a new access token when needed.  That flow keeps updating your refresh token, so as long as you keep using the newer refresh token, your solution should work (I believe refresh tokens on their own are good for a year). The github sample above should also help in this regard.

希望这会有所帮助。


这篇关于从网站上传文件到skydrive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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