Javascript save data to file system (with user prompt)

前端 未结 1 1038
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-28 10:05

What is the best way to achieve the below in latest latest browsers (with html5 support). I mainly target Google Chrome.

In my application, data is manipulated throu

相关标签:
1条回答
  • 2020-12-28 10:12

    I agree with Nathan Hayfield. The browser will handle the save dialog box for you. Setting the header Content-Disposition will send the response back as an attachment and the browser will handle it from there. eg.

    content.Headers.Add("Content-Disposition", "attachment; filename=export.csv");
    
    0 讨论(0)
提交回复
热议问题