0

我已经通过文档 API 上传了一个(pgp)文件,并将其可见性更改为公开。但是,我无法使用该文件的内容链接公开下载它。

以下是相关文件元数据的 xml 相关位。

$ curl -H "GData-Version: 3.0" -H "Authorization: Bearer ..." https://docs.google.com/feeds/default/private/full

...
    <content type="application/pgp-encrypted" src="https://doc-0c-c0-docs.googleusercontent.com/docs/securesc/tkl8gnmcm9fhm6fec3160bcgajgf0i18/opa6m1tmj5cufpvrj89bv4dt0q6696a4/1336514400000/04627947781497054983/04627947781497054983/0B_-KWHz80dDXZ2dYdEZ0dGw3akE?h=16653014193614665626&amp;e=download&amp;gd=true"/>
...
    <gd:feedLink rel="http://schemas.google.com/acl/2007#accessControlList" href="https://docs.google.com/feeds/default/private/full/file%3A0B_-KWHz80dDXZ2dYdEZ0dGw3akE/acl"/>

$ curl -H "GData-Version: 3.0" -H "Authorization: Bearer ..." https://docs.google.com/feeds/default/private/full/file%3A0B_-KWHz80dDXZ2dYdEZ0dGw3akE/acl

...
  <entry gd:etag="W/&quot;DUcNRns4eCt7ImA9WhVVFUw.&quot;">
    <id>https://docs.google.com/feeds/id/file%3A0B_-KWHz80dDXZ2dYdEZ0dGw3akE/acl/default</id>
...
    <gAcl:role value="reader"/>
    <gAcl:scope type="default"/>
...

为相关文件返回的角色/范围是reader/default,表示它是公共的。(它还会在 Web UI 中显示为公共共享访问。)

但是,访问 content 元素中的 src 属性会导致:

$ curl --verbose 'https://doc-0c-c0-docs.googleusercontent.com/docs/securesc/tkl8gnmcm9fhm6fec3160bcgajgf0i18/opa6m1tmj5cufpvrj89bv4dt0q6696a4/1336514400000/04627947781497054983/04627947781497054983/0B_-KWHz80dDXZ2dYdEZ0dGw3akE?h=16653014193614665626&e=download&gd=true'

< HTTP/1.1 401 Unauthorized
< Server: HTTP Upload Server Built on May 7 2012 18:16:42 (1336439802)
< WWW-Authenticate: GoogleLogin realm="http://www.google.com/accounts"
< Date: Tue, 08 May 2012 22:48:37 GMT
< Expires: Tue, 08 May 2012 22:48:37 GMT
< Cache-Control: private, max-age=0
< Content-Length: 0
< Content-Type: text/html
4

1 回答 1

1

您似乎正在尝试发布文档:https ://developers.google.com/google-apps/documents-list/#publishing_documents_by_publishing_a_single_revision

发布后,rel 设置为“http://schemas.google.com/docs/2007#publish”的链接将指向网络上发布的文档。

于 2012-05-09T22:35:08.323 回答