Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] 第57天 你了解HTML5的download属性吗? #236

Open
haizhilin2013 opened this issue Jun 11, 2019 · 10 comments
Open

[html] 第57天 你了解HTML5的download属性吗? #236

haizhilin2013 opened this issue Jun 11, 2019 · 10 comments
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第57天 你了解HTML5的download属性吗?

@haizhilin2013 haizhilin2013 added the html html label Jun 11, 2019
@xiangshuo1992
Copy link
Contributor

<a href="/wordpress/wp-content/themes/default/images/index_logo.gif" download="_5332_">下载</a>
没用过,也不了解,但是看了下兼容性还是挺大问题的,实用性不高。

@YiXing170
Copy link

之前做流下载的时候设置过download属性,将下载文件的名称变为用户名,但真不知道兼容性😀

@xiangshuo1992
Copy link
Contributor

@YiXing170 那怎么上线呢?难道是我看错了兼容性

@YiXing170
Copy link

@YiXing170 那怎么上线呢?难道是我看错了兼容性

我司只兼容chrome,哈哈

@NieHang
Copy link

NieHang commented Jun 22, 2019

我倒是用过,用它来下载base64格式的图片,兼容性倒是不咋地

@Vi-jay
Copy link

Vi-jay commented Jul 31, 2019

自定义下载文件的名称

@jiamianmao
Copy link

今年了解到的特性,在项目中使用过几次了,很好用,实乃居家旅行必备,只是资源需要在同源地址下。
兼容性的话,我们这儿不太考虑IE。

@censek
Copy link

censek commented Nov 27, 2019

<a> download 属性,规定被下载的超链接目标

download 属性也可以设置一个值来规定下载文件的名称。所允许的值没有限制,浏览器将自动检测正确的文件扩展名并添加到文件 (.img, .pdf, .txt, .html, 等等)。

@vinceok
Copy link

vinceok commented Jan 16, 2020

download 属性规定被下载的超链接目标,该属性也可以设置一个值来规定下载文件的名称。兼容性各异,Chrome和Firefox仅支持加载同源链接.。
参考CANIUSE:https://www.caniuse.com/#search=a%20download

@MrZ2019
Copy link

MrZ2019 commented Dec 7, 2020

<a> download 属性,规定被下载的超链接目标

download 属性也可以设置一个值来规定下载文件的名称。所允许的值没有限制,浏览器将自动检测正确的文件扩展名并添加到文件 (.img, .pdf, .txt, .html, 等等)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html html
Projects
None yet
Development

No branches or pull requests

9 participants