Using CSVHelper to output stream to browser

前端 未结 3 1564
时光说笑
时光说笑 2020-12-05 04:32

I\'m trying to use CSVHelper to generate a CSV file and send it back to a browser, so the user can select a save location and filename and save the data.

The websit

3条回答
  •  不知归路
    2020-12-05 05:14

    Try in the controller:

    HttpContext.Response.AddHeader("content-disposition", "attachment; filename=payments.csv");
    

提交回复
热议问题