Difference between FileStreamResult and FilePathResult?

后端 未结 1 775
夕颜
夕颜 2021-02-19 07:34

I have a simple controller which returns images:

public class ImageController : Controller
{
    [AcceptVerbs(HttpVerbs.Get)]
    [OutputCache(CacheProfile = \"S         


        
1条回答
  •  孤城傲影
    2021-02-19 08:32

    It appears that the HttpResponse.TransmitFile that is used in FilePathResult has or have had a few problems. It might depend on the version of Windows you are running your server according to this hotfix. If you search on Google for something like 'response.TransmitFile error' you get a lot of errors.

    I guess you should use your original code!

    0 讨论(0)
提交回复
热议问题