receive file via websocket and initiate download dialog

后端 未结 2 802
故里飘歌
故里飘歌 2020-12-15 11:14

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 th

2条回答
  •  一整个雨季
    2020-12-15 11:55

    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

提交回复
热议问题