错误信息
"Requested URL: /selva/DDL COMMANDS.doc"
实际上我的文件路径应该是
URL:/selva/Docs/DDL COMMANDS.doc
我用过的代码:
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = gvDetails.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "application/doc";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath("~/+ filePath + "));
Response.End();
在 aspx 中
任何人都可以尽快帮助我,这可能是什么错误。提前致谢。