比如我指定一个文件  http:\\10.0.0.1:8080\shagua\bushiwo.avi我用window.open  打开这个链接;结果直接用播放器打开了;
有什么方法想邮箱里的附件"下载" 类似的功能呢?
我看疼讯的邮件 就有这个功能  还不被 迅雷等下载工具 捕获

解决方案 »

  1.   

    string filepath = Server.MapPath("~/xxx.avi");
        string filename = System.IO.Path.GetFileName(filepath);
        Response.Clear();
        Response.ContentType = "application/octet-stream";
        Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
        Response.Flush();
        Response.WriteFile(filepath);
      

  2.   

    不行; 你这是c#里写的吧; 我是想说 js上 怎么直接能弹出 保存对话;
    而不是下载到临时文件夹后 被直接打开;
      

  3.   

    <a href=" http:\\10.0.0.1:8080\shagua\bushiwo.avi">下载</a>
      

  4.   

    <a href=" http:\\10.0.0.1:8080\shagua\bushiwo.avi">下载</a>