xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

HTML5 download file All In One

HTML5 download file All In One

HTML5 download & Fetch API & File API & Blob

https://scarletsky.github.io/2016/07/03/download-file-using-javascript/

auto download images

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

<p>Click on the image to download it:<p>

<a href="/images/myw3schoolsimage.jpg" download>
  img
</a>

HTML5 download 执行条件

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download

image

download normal file

https://stackoverflow.com/questions/3102226/how-to-set-name-of-file-downloaded-from-browser/48064008#48064008

download blob file

https://stackoverflow.com/questions/71686536/how-to-set-the-download-file-extension-for-blob-data/71895888#71895888

https://github.com/xgqfrms/HTML5/issues/11

refs

https://github.com/eligrey/FileSaver.js/blob/master/FileSaver.js

https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL

https://developer.mozilla.org/en-US/docs/Web/API/Blob

http://stackoverflow.com/questions/19327749/javascript-blob-filename-without-link

http://stackoverflow.com/questions/24501358/how-to-set-a-header-for-a-http-get-request-and-trigger-file-download

http://blog.bguiz.com/2014/07/03/file-download-with-http-request-header/



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2018-12-07 14:46  xgqfrms  阅读(160)  评论(8编辑  收藏  举报