Hi team- For ms project export from web api C# I am converting .mpp memory stream to required “application/vnd.ms-project” format but getting empty file or null content. below is the code
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.Accepted);
MemoryStream ms = new MemoryStream(data);
result.Content = new StreamContent(ms);
result.Content.Headers.ContentType = new MediaTypeHeaderValue(“application/vnd.ms-project”);
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue(“attachment”)
{
FileName = fileName + DateTime.Now.ToString(“MM-dd-yyyy_HH-mm”) + “.mpp”
};
result.Content.Headers.Add("Access-Control-Expose-Headers", new[] { "Content-Disposition" });