SVN r564
SVN-Revision: r564
This commit is contained in:
@@ -2976,6 +2976,8 @@ namespace Lskj.Control.Model
|
|||||||
if (!string.IsNullOrEmpty(token))
|
if (!string.IsNullOrEmpty(token))
|
||||||
{
|
{
|
||||||
string speciesno = "010105";
|
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(" ", "")}'";
|
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);
|
DataTable deleteTable = BaseImpl.GetDataTableResult(selectSql);
|
||||||
if (deleteTable != null && deleteTable.Rows.Count > 0)
|
if (deleteTable != null && deleteTable.Rows.Count > 0)
|
||||||
@@ -2990,11 +2992,9 @@ namespace Lskj.Control.Model
|
|||||||
HttpHelper.Setting("application/x-www-form-urlencoded", null, null);
|
HttpHelper.Setting("application/x-www-form-urlencoded", null, null);
|
||||||
Dictionary<string, string> deleteHeaderDic = new Dictionary<string, string>();
|
Dictionary<string, string> deleteHeaderDic = new Dictionary<string, string>();
|
||||||
deleteHeaderDic.Add("Authorization", $"Bearer {token}");
|
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}";
|
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);
|
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);
|
bool isUpload = UploadFileUtil.UploadFile(token, postUrl, fileStream, out string fileId, out string rtnMsg);
|
||||||
|
|||||||
Reference in New Issue
Block a user