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

网页保存文件的实现 #23

Closed
xiaweiss opened this issue May 25, 2020 · 0 comments
Closed

网页保存文件的实现 #23

xiaweiss opened this issue May 25, 2020 · 0 comments
Labels

Comments

@xiaweiss
Copy link
Owner

xiaweiss commented May 25, 2020

https://github.com/eligrey/FileSaver.js/wiki/Saving-a-remote-file#using-http-header

请求资源时,可以通过设置头统一返回文件,不指明具体类型。浏览器会直接下载处理
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="filename.jpg"; filename*="filename.jpg"

相关库

https://github.com/jimmywarting/StreamSaver.js
https://stuk.github.io/jszip/

中文资料
https://www.zhangxinxu.com/wordpress/2019/08/js-zip-download/

@xiaweiss xiaweiss added the Web label May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant