Controllers
public FileResult Download()
{
byte[] fileBytes = System.IO.File.ReadAllBytes("c:\folder\myfile.ext");
string fileName = "myfile.ext";
return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
}
View
trong view thêm actionLink
@Html.ActionLink("download","Download","Home")
No comments:
Post a Comment