Google云端硬盘中的图片链接无法在Google Script中使用 [英] Image link from Google Drive not working in Google Script
问题描述
我试图在谷歌脚本中使用我的谷歌驱动器中的图像,以便它可以用作标题。但它不工作,只显示顶部的小缩略图图标。我使用下面的代码来实现它:
I am trying to use image from my google drive in google script so that it can be used as a header. But it's not working and just shows small thumbnail icon at top. I am using the following code to achieve this:
var gridLogo = app.createGrid(1, 1);
gridLogo.setWidget(0, 0, app.createImage('https://docs.google.com/...'));
为保护隐私,将点放在上述链接中。
Dots are put in above link for privacy purpose.
我已将该网站发布为Web应用程序,并且可以由我自己访问。
I have published the site as Web App and can be accessible by myself.
有什么我缺少的吗?请提示。
Is there anything I am missing? Please suggest.
谢谢
Thanks
推荐答案
您应该尝试使用永久链接的图像:
http: //googlesystem.blogspot.fr/2013/02/permalinks-for-google-drive-images.html
You should try using the permalink of the image:
http://googlesystem.blogspot.fr/2013/02/permalinks-for-google-drive-images.html
网址需要从此更改:
http://docs.google.com/file/d / FILEID /编辑
至此
http://drive.google.com/uc?export=view&id=FILEID
the URL need to be changed from this:
http://docs.google.com/file/d/FILEID/edit
to this
http://drive.google.com/uc?export=view&id=FILEID
这篇关于Google云端硬盘中的图片链接无法在Google Script中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!