SVN-Revision: r564
This commit is contained in:
tdx
2025-05-08 13:40:03 +00:00
parent 327dac14e9
commit 2d92e972de
+3 -3
View File
@@ -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<string, string> deleteHeaderDic = new Dictionary<string, string>();
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);