public ActionResult Download(long id) { var binaryFile = binaryFileRepository.Load(id); var stream = GetFileProvider().Load(binaryFile); return(File(stream, binaryFile.ContentType)); }
public ActionResult Download(long id) { var binaryFile = binaryFileRepository.Load(id); var stream = GetFileProvider().Load(binaryFile); if (stream == null) { return(new EmptyResult()); } return(File(stream, binaryFile.ContentType, binaryFile.Name)); }