使用Google云端硬盘缩略图的正确方式是什么? [英] What's the correct way of using the Google Drive thumbnails?

查看:391
本文介绍了使用Google云端硬盘缩略图的正确方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着先存储并使用API​​返回的链接,但它会在很短的时间内过期。然后我尝试在本地下载和存储图像(并从我的服务器上提供);但是当我没有用我的账户登录时,缩略图链接会引发404错误(尽管这些文档是完全公开的)。



服务/检索的正确方式是什么一个文件的缩略图?

解决方案

我终于解决了这个问题。如果您在过期之前获取URL并使用经过身份验证的客户端(使用必须访问该API的令牌),则可以下载缩略图。最后这一点很重要,因为正常的GET请求会收到404错误。否则。

I've tried first to store and use the link the API returns, but it expires in a short amount of time. Then I tried to download and store the image locally (and serve it from my servers); but the thumbnail links throws a 404 error when I'm not logged in with my account (though the documents are fully public).

What's the correct way of serving/retrieving the thumbnail of a document?

解决方案

I finally solved the problem. You can download the thumbnails if you fetch the URL before it expires and you use an authenticated client (using the token you have to access the API). This last bit it's important, because a normal GET request will receive a 404 error otherwise.

这篇关于使用Google云端硬盘缩略图的正确方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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