Last active
August 29, 2015 14:16
-
-
Save arn-e/d405b8e85fce60d4607f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public HttpResponseMessage ReadWidget(long id) | |
{ | |
WidgetBusiness widgetBusiness = new WidgetBusiness(); | |
Widget widget = widgetBusiness.Get(id); | |
HttpResponseMessage response = new HttpResponseMessage(); | |
response.Content = new ByteArrayContent(widget.Data); | |
response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment"); | |
response.Content.Headers.ContentDisposition.FileName = widget.Id.ToString(); | |
response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/jpg"); | |
return response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment