通过websocket接收文件并启动下载对话框 [英] receive file via websocket and initiate download dialog
本文介绍了通过websocket接收文件并启动下载对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢!
解决方案
您需要构建一个dataUri并打开一个新的窗口。具体的mimetype可以触发浏览器的自动保存为对话框。
示例数据uri:data:application / octet-stream,base64+ base64binary
my HTML5 web application receives a file as binary data via a websocket. Is there any way to initiate a file download dialog (via javascript) to save the received data to the users disk?
Thank you!
解决方案
You need to build a dataUri and open a new window with this. Specific mimetypes can trigger the browser's automatic save as dialog.
Example data uri: "data:application/octet-stream,base64" + base64binary
这篇关于通过websocket接收文件并启动下载对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文