62,041
社区成员
发帖
与我相关
我的任务
分享
if (Request["GuidName"] != null && Request["FileName"] != null)
{
LoadResources();
string guidName = Request["GuidName"].Trim();
string displayName = Request["FileName"].Trim();
string trueFileName = string.Empty;
if (guidName == "Importing")
{
trueFileName = displayName;
guidName = displayName;
}
else
{
trueFileName = SystemSetOperator.GetOriginalDocumentNameByDiskName(guidName);
}
try
{
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.Charset = "utf-8";
Response.Buffer = true;
Response.ContentType = "APPLICATION/OCTET-STREAM";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AppendHeader("Content-Disposition", "attachment;FileName = "
+ Server.UrlEncode(trueFileName).Replace("+", "%20"));
DataTable dtPathList = new DataTable();
dtPathList = SystemSetOperator.GetSSystemDocByDiskname(guidName);
string sPath = string.Empty;
sPath = dtPathList.Rows[0]["Sys_Path"].ToString().Trim() + '\\' + dtPathList.Rows[0]["Type_Path"].ToString().Trim();
string site = dtPathList.Rows[0]["site"].ToString().Trim();
string fileName = sPath + "\\" + guidName;
//if (FolderAction.DocumentDownload(fileName, site)) {
Response.WriteFile(fileName);
// }
Response.End();
}