[英]How to read and download binary file in react/js
I have base64 data of a file coming from API to react and need to read and download this file in it's actual form PDF, doc, ..
or link the download action to a button我有来自 API 的文件的 base64 数据做出反应,需要以实际形式阅读和下载此文件PDF, doc, ..
或链接下载操作
Try this:尝试这个:
<a download="filename.png" href="data:image/png;base64,foo...">Download</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.