From c2448c36cca517eff2909be7ef803513830a0d29 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Fri, 22 Dec 2023 15:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/Common/UploadAttachmentService.cs | 3 ++- SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs | 10 ++++++---- SGGL/FineUIPro.Web/SysManage/Doc.aspx | 6 ++++++ SGGL/FineUIPro.Web/SysManage/Doc.aspx.designer.cs | 9 +++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/SGGL/BLL/Common/UploadAttachmentService.cs b/SGGL/BLL/Common/UploadAttachmentService.cs index 4266c436..3639322e 100644 --- a/SGGL/BLL/Common/UploadAttachmentService.cs +++ b/SGGL/BLL/Common/UploadAttachmentService.cs @@ -72,7 +72,8 @@ namespace BLL string url = rootPath + arrStr[i].Replace('\\', '/'); string[] subUrl = url.Split('/'); string fileName = subUrl[subUrl.Count() - 1]; - string newFileName = fileName.Substring(fileName.IndexOf("_") + 1); + //string newFileName = fileName.Substring(fileName.IndexOf("_") + 1); + string newFileName = fileName; htmlStr += "" + newFileName + ""; } } diff --git a/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs b/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs index 251ac1c7..0edfb729 100644 --- a/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs +++ b/SGGL/FineUIPro.Web/AttachFile/fileupload.ashx.cs @@ -49,7 +49,7 @@ namespace FineUIPro.Web.AttachFile // 文件名完整路径 string fileName = postedFile.FileName; // 文件名保存的服务器路径 - string savedFileName = GetSavedFileName(fileName).Replace('#', '-'); ; + string savedFileName = GetSavedFileName(fileName,owner).Replace('#', '-'); ; postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName)); string shortFileName = GetFileName(fileName); @@ -123,11 +123,13 @@ namespace FineUIPro.Web.AttachFile return shortFileName; } - private string GetSavedFileName(string fileName) + private string GetSavedFileName(string fileName,string owner) { fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_"); - fileName = DateTime.Now.Ticks.ToString() + "_" + fileName; - + if (!owner.Contains("DocAttachUrl")) + { + fileName = DateTime.Now.Ticks.ToString() + "_" + fileName; + } return fileName; } diff --git a/SGGL/FineUIPro.Web/SysManage/Doc.aspx b/SGGL/FineUIPro.Web/SysManage/Doc.aspx index 261974ee..a39cacfd 100644 --- a/SGGL/FineUIPro.Web/SysManage/Doc.aspx +++ b/SGGL/FineUIPro.Web/SysManage/Doc.aspx @@ -53,6 +53,12 @@ SortField="DocDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="编制日期" HeaderTextAlign="Center" TextAlign="Center"> + + + + + diff --git a/SGGL/FineUIPro.Web/SysManage/Doc.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/Doc.aspx.designer.cs index ef732f8a..8a7044ff 100644 --- a/SGGL/FineUIPro.Web/SysManage/Doc.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/SysManage/Doc.aspx.designer.cs @@ -93,6 +93,15 @@ namespace FineUIPro.Web.SysManage { /// protected global::System.Web.UI.WebControls.Label lblNumber; + /// + /// lbtnFileUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl; + /// /// ToolbarSeparator1 控件。 ///