Hi I have created a web api application and I am returning response as text file. Now I want to return a zipped file so that its size is reduced
This is my controller code
public HttpResponseMessage Get(String parameter)
{
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent(informationcontext.Records(parameter));
response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain");
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = "sample"
};
return response;
}
Can any one help me in this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…