public ActionResult DownAttachment(string dUrl, string fileName) { try { dUrl = HttpUtility.UrlDecode(dUrl); var bytes = new System.Net.WebClient().DownloadData(dUrl); Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName); Response.BinaryWrite(bytes); Response.Flush(); Response.End(); } catch (Exception ex) { Response.Write("<script>alert('下载失败!远程服务器异常!');</script>"); } return new EmptyResult(); }