From 2d92e972deab75a8dbd0b195d55d2af95e718a63 Mon Sep 17 00:00:00 2001 From: tdx Date: Thu, 8 May 2025 13:40:03 +0000 Subject: [PATCH] SVN r564 SVN-Revision: r564 --- 插件库/Lskj.Control/Model/MyControl.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/插件库/Lskj.Control/Model/MyControl.cs b/插件库/Lskj.Control/Model/MyControl.cs index ccd0b16..5c3b9e0 100644 --- a/插件库/Lskj.Control/Model/MyControl.cs +++ b/插件库/Lskj.Control/Model/MyControl.cs @@ -2976,6 +2976,8 @@ namespace Lskj.Control.Model if (!string.IsNullOrEmpty(token)) { string speciesno = "010105"; + byte[] fileBytes = UploadFileUtil.ConvertFileToBytes(filePath); + string fileStream = Convert.ToBase64String(fileBytes); string selectSql = $"select * from P_fm_FileTab where parentid in (select dirid from P_fm_DirectoryTab where pid = '{idValue}' and dllcoid = '{Model.ModuleCode}') and speciesno = '{speciesno}' and sname = '{Path.GetFileName(filePath).Replace(" ", "")}'"; DataTable deleteTable = BaseImpl.GetDataTableResult(selectSql); if (deleteTable != null && deleteTable.Rows.Count > 0) @@ -2990,11 +2992,9 @@ namespace Lskj.Control.Model HttpHelper.Setting("application/x-www-form-urlencoded", null, null); Dictionary deleteHeaderDic = new Dictionary(); deleteHeaderDic.Add("Authorization", $"Bearer {token}"); - HttpHelper.Post(deleteUrl, "", null, deleteHeaderDic, out string deleteResult); + HttpHelper.Post(deleteUrl, fileStream, null, deleteHeaderDic, out string deleteResult); } } - byte[] fileBytes = UploadFileUtil.ConvertFileToBytes(filePath); - string fileStream = Convert.ToBase64String(fileBytes); string postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&idValue={2}&speciesno={8}&folder={3}&totsize={4}&position={5}&filename={6}&method={7}"; postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, Model.ModuleCode, HttpUtility.UrlEncode(idValue), "file", fileBytes.Length, 0, HttpUtility.UrlEncode(Path.GetFileName(filePath)), "DoWebUpload", speciesno); bool isUpload = UploadFileUtil.UploadFile(token, postUrl, fileStream, out string fileId, out string rtnMsg);