我的系统要求能一次下载两个附件,可以出现选择路径的提示框,文件名不需要客户输入,因为下载两个文件后需要运行外部程序进行比对。
请教高手们能不能实现?难道只能用笨办法:放两个按钮,让用户下载两次!!

解决方案 »

  1.   

    Response.write写两次不知道行不行那两个附件不能打包么?
      

  2.   

    Response.Redirect两次不行,我试过了!
      

  3.   

    down.aspx?myfile1=×××&myfile2=×××
    判断myfile1,myfile2是否为空
    if(myfile1.Trim()!="")
                {
                
                    string path = Server.MapPath(myfile1);                System.IO.FileInfo file = new System.IO.FileInfo(path);
                    Response.Clear();
                    Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
                    Response.AddHeader("Content-Length", file.Length.ToString());
                   
                    Response.ContentType = "application/octet-stream";
                    Response.WriteFile(file.FullName);
                    Response.End();
                }
    if(myfile2.Trim()!="")
                {
                
                    string path = Server.MapPath(myfile2);                ...
                }
      

  4.   

    既然“比对”,那么应该由你的比对程序集成(http get/post)下载功能,不在网页设计上考虑。