public async Task <ActionResult> DownloadDocument(int fileId) { var document = await _documentService.GetDocumentByFileIdAsyncTask(fileId); var cd = new ContentDisposition { FileName = document.FileName, Inline = false }; Response.AppendHeader("Content-Disposition", cd.ToString()); return(File(document.DocumentFile, _documentFactory.GetMimeTypeByFormatType(document.FileType))); }