日期:2014-05-18  浏览次数:20453 次

能否一次下载两个附件?
我的系统要求能一次下载两个附件,可以出现选择路径的提示框,文件名不需要客户输入,因为下载两个文件后需要运行外部程序进行比对。
请教高手们能不能实现?

难道只能用笨办法:放两个按钮,让用户下载两次!!

------解决方案--------------------
沙发又被抢了?
------解决方案--------------------
再占一楼帮忙顶
------解决方案--------------------
Response.write写两次不知道行不行

那两个附件不能打包么?
------解决方案--------------------
Response.Redirect两次不就行吗
------解决方案--------------------
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);

...
}


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