开发者社区 问答 正文

关于ie8下的下载问题 求指点》?403.10 禁止访问:配置无效

 protected void downF( string select)
        {
             string path="";
            if(select=="xls")
           path = Server.MapPath("examplexls.rar");
            else path = Server.MapPath("exampletxt.rar");
            //初始化 FileInfo 类的实例,它作为文件路径的包装
            FileInfo fi = new FileInfo(path);
            //判断文件是否存在
            if (fi.Exists)
            {
                //将文件保存到本机上
                Response.Clear();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(fi.Name));
                Response.AddHeader("Content-Length", fi.Length.ToString());
                Response.ContentType = "application/octet-stream";
                Response.Filter.Close();
                Response.WriteFile(fi.FullName);
                Response.End();
            }


        }
对了  我在做下载的时候 遇到一个问题 就是这段代码在ie8 中是无效的  求解释  这是为什么涅  

展开
收起
kun坤 2020-05-28 13:24:25 574 分享 版权
1 条回答
写回答
取消 提交回答
  • 怎么个没效法呢?######

    引用来自#2楼“华宰”的帖子

    怎么个没效法呢?

     点击了  后台执行了 但是没有出现下载的那个对话框
    2020-05-28 16:29:38
    赞同 展开评论
问答标签:
问答地址: