点击背景图片,从链接下载图片,显示进程栏javascript

Click on background image and download the image from the link and show process bar javascript

本文关键字:显示 进程 javascript 下载 背景图片 链接      更新时间:2023-09-26

我有一个虚拟图像

<a href="http://example.com/filename"><img src="dummy.jpg"></a>

点击虚拟图像,我需要下载第三方服务器上的文件。该文件可能是图像或mp4文件。

下载时需要显示进度条,显示下载百分比

点击后直接下载文件使用下载属性

<a href="http://example.com/filename" download>
    <img src="dummy.jpg">
</a>

如果您想重命名文件,那么您可以使用带有下载属性的值

<a href="http://example.com/filename" download="new_file_name">
    <img src="dummy.jpg">
</a>