日期:2014-05-16 浏览次数:20483 次
public ActionResult Xz(string id)
{
Vuploadfile file = factory.GetUploadfileBusiness().GetById(id);
string fileName = file.Mc;//客户端保存的文件名
string filePath = Server.MapPath(file.Path);//路径
filePath = filePath.TrimEnd('/').TrimStart('/');
var stream = new System.Net.WebClient().OpenRead(filePath);
return File(file.Path, "text/plain", Url.Encode(fileName));
}
 function DownLoad(id) {
       $.ajax({
           url: '/Manage/Uploadfile/Xz/' + id, //执行后台代码
           type: "POST",
           success: function (Data) {
//               document.write( Data);
           },
           error: function () {
               $.messager.alert('提示', '修改不成功!', 'error');
           }
              });
   }