阅读Google云端硬盘中公共共享文件的内容 [英] Read content of public shared file in Google Drive

查看:543
本文介绍了阅读Google云端硬盘中公共共享文件的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



应用程序需要读取某人Google Drive中公共共享文件的内容。



我该怎么做?



是否有API来实现这一目标?

webContentLink 属性,当文件被公开时,不应该要求任何认证/授权。



这是一个feil元数据示例:



这是如何使用通用客户端库获取文件元数据: https://developers.google.com/drive/v2/reference/fil es / get


I am working on a Google Drive application.

The application needs to read the contents of a publically shared file in someone's Google Drive.

How can I do this?

Is there an API to achieve this?

解决方案

When using the Google Drive API, after setting the ACL of the file to be public you can directly access the file using the webContentLink attribute of the file metadata which should not require any authentication/authorization when the file is public.

This is a feil metadata example: https://developers.google.com/drive/v2/reference/files#resource

This is how to get the file metadata using common client libraries: https://developers.google.com/drive/v2/reference/files/get

这篇关于阅读Google云端硬盘中公共共享文件的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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