adding header to http response in an action inside a controller in asp.net/mvc

前端 未结 5 2196
花落未央
花落未央 2021-02-13 18:14

I am streaming data from server to client for download using filestream.write. In that case what is happening is that I am able to download the file but it does not

5条回答
  •  没有蜡笔的小新
    2021-02-13 18:59

    Change:

    return RedirectToAction("Index");
    

    to:

    return File(fs, "your/content-type", "filename");
    

    And move the return statement to inside your using statement.

提交回复
热议问题