SkyDrive Javascript SDK读取文件问题 [英] SkyDrive Javascript SDK read file issue

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

问题描述

我正在使用SkyDrive SDK开发一个网络应用程序。


我发现无法使用Javascript SDK读取SkyDrive上纯文本文件的内容。


似乎Microsoft确实提供了一个REST API来读取文件内容( http:// msdn。 microsoft.com/en-us/library/live/hh243648.aspx#file  ):



   要下载  文件  资源,
制作 
GET  请求
到/
FILE_ID /内容。
文件内容在响应正文中返回。


我通过命令行工具直接调用此REST API,成功读取了我的文本文件的内容。

解决方案

使用方法GET的WL.api(...)不是为下载原始文件而设计的。不幸的是,要在JS上下文中下载内容,您可以考虑使用服务器作为代理来下载文件内容。


谢谢,



Hi, I'm developing a web app using SkyDrive SDK.

I found it impossible to read the content of a plain text file on SkyDrive using the Javascript SDK.

It seems like Microsoft does provide a REST API to read the file content (http://msdn.microsoft.com/en-us/library/live/hh243648.aspx#file  ):

    To download the content of a File resource, make a GET request to/FILE_ID/content. The file content is returned in the response body.

I successfully read the content of my text file by calling this REST API directly from my command line tools.

解决方案

WL.api(...) with method GET is not designed for downloading the orginal file. Unfortunately, To download content in JS context, you may consider to use your server as proxy to download the content of a file.

Thanks,

Lin


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

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