亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - Can cross-domain download files with a tag be renamed?
過去多啦不再A夢
過去多啦不再A夢 2017-05-24 11:33:26
0
2
1822

Can cross-domain download files with a tag be automatically renamed when clicking download?
The file is not on my server
I don’t want to save this file on my server
Is there a way for users to automatically rename the file name when downloading by clicking the a tag?

過去多啦不再A夢
過去多啦不再A夢

reply all(2)
僅有的幸福

You can use the HTML5中的download attribute, refer to w3school:

<a  download="baidu">

Attached is a cross-domain solution

Nginx (Same as Apache):

location /imgProxy {
    resolver 10.0.0.1;
    proxy_pass $arg_url;
}

<a href="/imgProxy?url=https://static.segmentfault.com/v-5922866b/global/img/logo-b.svg" download="logo">segmentfault</a> 
PHPzhong

Currently only Chrome supports this feature:

<a href="..." download="file.mp4">Download</a>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template