//服务器文件路径string strFilePath = Server.MapPath("~") + "/excel/20170206104654.xlsx";FileInfo fileInfo = new FileInfo(strFilePath);Response.Clear();Response.AddHeader("content-disposition", "attachment;filename=" + Server.UrlEncode(fileInfo.Name.ToString()));Response.AddHeader("content-length", fileInfo.Length.ToString());Response.ContentType = "application/octet-stream";Response.ContentEncoding = System.Text.Encoding.Default;Response.WriteFile(strFilePath);
以上所述是小编给大家介绍的asp.net实现服务器文件下载到本地的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!