User265788195 posted
I am trying to open an excel report, it shows me a warning that the file that I am trying top open is in a different format than specified by the file extension...
This code is not working as I wanted, can you help me with that please...
[HttpGet]
public HttpResponseMessage Get([FromUri]StormEventSearchCriteria criteria)
{
........
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new ByteArrayContent(bytes);
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.ms-excel");
response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
response.Content.Headers.ContentDisposition.FileName = "EventReport.xls";
return response;
}