Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <param name="fullFilePath">Path to file on disc</param>
- /// <param name="fileName">Name of file. This will be displayed in browser's save dialog</param>
- public FilePathResult DownloadFile(string fullFilePath)
- {
- var fileName = new FileInfo(fullFilePath).Name;
- var contentType = System.Web.MimeMapping.GetMimeMapping(fullFilePath);
- return new FilePathResult(fullFilePath, contentType)
- {
- FileDownloadName = fileName
- };
- }
Add Comment
Please, Sign In to add comment