关于上述主题,我有一个错误,基本上我只是从其路径下载文件。我的下载代码是:
[323, 456, 654, 1, 34, 33, 45, 5432, 34566]
我必须多次刷新页面才能下载该项目,但我在行string sFile = Request.QueryString["RFBNumber"].ToString();
string sFile2 = Request.QueryString["FolderName"].ToString();
string sFlag = Request.QueryString["Flag"].ToString();
//CreateRFBReport(sFile, sFile2);
//CreateSingleFile(sFile2, sFile);
if (sFlag == "1") {
sFilename = "RFB_" + sFile + "_COLLATED.PDF";
sGlobalFolderName = sFile2;
sFilePath = @ "" + sGlobalFolderName + "\\" + sFilename;
WebClient client = new WebClient();
byte[] buff = client.DownloadData(sFilePath);
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buff.Length.ToString());
Response.BinaryWrite(buff);
}
if (sFlag == "2") {
sFilename = "SOP_" + sFile + "_COLLATED.PDF";
sGlobalFolderName = sFile2;
sFilePath = @ "" + sGlobalFolderName + "\\" + sFilename;
WebClient client = new WebClient();
byte[] buff = client.DownloadData(sFilePath);
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buff.Length.ToString());
Response.BinaryWrite(buff);
}
有人能帮帮我吗?一直在寻找解决这个问题的方法。提前谢谢。