public ActionResult ViewVideoResource(int VideoResourceId) { viewAdditionalResources supportdoc = CMSService.DownloadAdditionalResource(VideoResourceId); Stream stream = new MemoryStream(supportdoc.InputStream); return(new FileStreamResult(stream, supportdoc.ContentType)); }
public FileResult DownloadAdditonalResource(int Id) { viewAdditionalResources supportdoc = CMSService.DownloadAdditionalResource(Id); string folderName = System.Configuration.ConfigurationManager.AppSettings["_AdditionalResources"] + CMSService.ListOfAdditionalResourcesFolders().Where(f => f.Id == supportdoc.FolderTypeId).FirstOrDefault().Description.Replace(" ", ""); var fileSavePath = Path.Combine(folderName, supportdoc.FileName); byte[] fileBytes = System.IO.File.ReadAllBytes(fileSavePath); return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, supportdoc.FileName)); }