Prompting user to save file using a 'Save-as' dialog?

后端 未结 2 1025
借酒劲吻你
借酒劲吻你 2021-01-02 15:11

I currently have this code:

function download(filename, text) {
        var pom = document.createElement(\'a\');
        pom.setAttribute(\'href\', \'data:te         


        
2条回答
  •  孤独总比滥情好
    2021-01-02 15:22

    My browser was set to automatically download all files in default location which is why not only this file but all other files from my browser were downloaded directly without the save prompt dialogue. Changing the settings in browser to 'always ask the download location' worked.

提交回复
热议问题