如何链接到Google照片中的图片,但下载文件而不是打开文件

时间:2020-03-13 23:07:39

标签: html force-download

我已经意识到有很多方法可以将文件保存在计算机或服务器的根目录上进行下载,但是我找不到如何对Google相册中的特定图像进行处理的方法。

<div class="the-content">
  <p><img class="b-lazy" id="portrait" src="https://image from google photos"  align="" width="300" height="103000" alt="about">
  <a href="https://photos.google.com/SAME IMAGE FROM GOOGLE PHOTOS ALBUM">
  <button>GET</button>

1 个答案:

答案 0 :(得分:1)

使用a元素的download属性应该可以满足您的要求。

<a href="https://google.com/image/image.jpg" download>Download image.jpg</a>
or
<a href="https://google.com/image/image.jpg" download="rooster.jpg">Download image.jpg with the name rooster.jpg</a>

https://www.w3schools.com/tags/att_a_download.asp

相关问题