How to add Headers in HTTPContext Response in ASP.NET MVC 3?

前端 未结 5 1589
[愿得一人]
[愿得一人] 2020-12-17 16:17

I have a download link in my page, to a file I generate by the user request. Now I want to display the file size, so the browser can display how much is left to download. As

5条回答
  •  情歌与酒
    2020-12-17 16:35

    Try HttpContext.Current.Response.AppendHeader("Content-Length", contentLength);

提交回复
热议问题