string trackPathTemp = track.trackPath;
//The File Path
var videoFilePath = HttpContext.Current.Server.MapPath("~/" + trackPathTemp);
var stream = new FileStream(videoFilePath, FileMode.Open, FileAccess.Read);
var result = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StreamContent(stream)
};
result.Content.Headers.ContentType = new MediaTypeHeaderValue("video/mp4");
result.Content.Headers.ContentRange = new ContentRangeHeaderValue(0, stream.Length);
// result.Content.Headers.Add("filename", "Video.mp4");
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = "Video.mp4"
};
return result;