img src html 标签未从公共共享谷歌驱动程序文件夹加载公共图像

问题描述 投票:0回答:1

我正在尝试使用谷歌驱动程序将图像添加到 html 文档中。我通过以具有链接的任何人的身份提供共享选项来创建公共文件夹,并使用相同的共享选项在该文件夹中添加图像。但是,它不加载。 src 属性中使用的 URL 是使用另一个 SO 问题here获得的。

<td align="center" style="border-collapse:collapse;width:600px">
    <img src="https://drive.usercontent.google.com/download?id=1lHOxtnNsh88laZqNpZq8K4IA_Fpirtz9" alt="Rathsaptami3.JPG"></td>

我尝试将 URL 更改为其他图像地址,例如 amazon.com 产品图像,然后该图像就会加载。从 Google 云端硬盘加载图像的 URL 格式是否有任何变化?

html image url google-drive-api file-sharing
1个回答
0
投票

针对您的情况,进行以下修改如何?

模式1:

<td align="center" style="border-collapse:collapse;width:600px">
    <iframe src="https://drive.google.com/file/d/1lHOxtnNsh88laZqNpZq8K4IA_Fpirtz9/preview" allow="autoplay" alt="Rathsaptami3.JPG"></iframe></td>

模式2:

<td align="center" style="border-collapse:collapse;width:600px">
    <img src="https://drive.google.com/thumbnail?sz=w512&id=1lHOxtnNsh88laZqNpZq8K4IA_Fpirtz9" alt="Rathsaptami3.JPG"></td>
© www.soinside.com 2019 - 2024. All rights reserved.