4

I'm using BITS to make requests to a ASP.NET MVC controller method named Source that returns a FileResult. I know the type FilePathResult uses HttpResponse.TransmitFile, but I don't know if HttpResponse.TransmitFile actually writes the file to the response stream regardless of the request type.

My question is, does FileResult only include the header information on HEAD requests, or does it transmit the file regardless of the request type? Or, do I have to account for HEAD requests myself?

Michael Nero
  • 1,396
  • 13
  • 24

1 Answers1

0

The result is forced to react on a request by YOUR ACTION CODE. If you do not do anything special on different request types (e.g. [HttpGet]-Attribute, HttpMethodConstraints in the Route, etc...) The file is just written to the response stream.

Daniel Fisher lennybacon
  • 3,865
  • 1
  • 30
  • 38
  • response.TransmitFile does all sorts of things, it's quite a large abstraction.. Reacts differently to Range requests, etc. I don't think this is an answer I would bank on. – Matt Hinze Jun 10 '16 at 15:10