Created
June 28, 2011 22:31
-
-
Save nelsonlaquet/1052413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[EnsureCustomerLoggedIn] | |
public ActionResult Download(Guid assetId) | |
{ | |
var asset = _assets.GetAsset(assetId); | |
if (asset == null) | |
return Redirect(Url.RouteCatalog()); | |
var filePath = _uploads.GetAbsolutePathForFile(asset.FileId.UploadId); | |
return File(filePath, _mimeTypes.GetMimeTypeForFile(filePath), asset.Name + Path.GetExtension(filePath)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment