<a href=file\\\f:\***.rar />在程序中不能连接到磁盘上的文件 有什么办法能解决这个问题
------解决方案--------------------------------------------------------
用服务器程序做中转,二进制输出下载
ContentType="application/octet-stream"
------解决方案--------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
string FilePath = Request.QueryString["FilePath"]; //文件物理路径
using (System.IO.FileStream fs = new System.IO.FileStream(FilePath,System.IO.FileMode.Open))
{
byte[] byteBuffer = new byte[fs.Length];
fs.Read(byteBuffer,0,byteBuffer.Length);
Response.AddHeader("Content-Disposition", "attachment; filename="+System.IO.Path.GetFileName(FilePath));
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(byteBuffer);
Response.Flush();
}
}
<a href="down.aspx?filepath=f:\***.rar" / >