You could create a message handler to intercept the request and return the file. Read more about handlers here: http://www.asp.net/web-api/overview/working-with-http/http-message-handlers.
You will want to make sure to create the response, add your file stream, and return it. Just this alone is naive, but it should help you get started.
davebettin
Member
313 Points
94 Posts
Re: Hosting static content in a self-hosted webapi
Mar 27, 2012 03:29 AM|LINK
You could create a message handler to intercept the request and return the file. Read more about handlers here: http://www.asp.net/web-api/overview/working-with-http/http-message-handlers. You will want to make sure to create the response, add your file stream, and return it. Just this alone is naive, but it should help you get started.
@dbettin