if (File.Exists(Server.MapPath(filePath)))
{
string strFileName = Path.GetFileName(filePath).Replace(" ", "%20");
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName);
Response.Clear();
Response.WriteFile(Server.MapPath(filePath));
Response.End();//到此行也不报错 ,就直接没反应了
}
window.showModalDialog()弹出的窗口 里面有下载链接 如何让这下载好用???求帮忙!!!
{
string strFileName = Path.GetFileName(filePath).Replace(" ", "%20");
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName);
Response.Clear();
Response.WriteFile(Server.MapPath(filePath));
Response.End();//到此行也不报错 ,就直接没反应了
}
window.showModalDialog()弹出的窗口 里面有下载链接 如何让这下载好用???求帮忙!!!
<a href="页面.aspx?path=<%# Server.UrlEncode(Eval("path").ToString())%> "><%#Eval("path") %></a>
<a id="hi" onclick="loadFile()">abc</a>
然后在js里面这样写 function loadFile()
{
window.location = "filepath";
}