Returning binary file from controller in ASP.NET Web API

后端 未结 8 958
离开以前
离开以前 2020-11-22 02:55

I\'m working on a web service using ASP.NET MVC\'s new WebAPI that will serve up binary files, mostly .cab and .exe files.

The following co

8条回答
  •  孤城傲影
    2020-11-22 03:45

    You could try

    httpResponseMessage.Content.Headers.Add("Content-Type", "application/octet-stream");
    

提交回复
热议问题