개정판 6e5f7eaf
issue #1115: 업로드 시 GetFileName 부분 수정. file move 전 대상 파일이 존재 하면 삭제 후 move 하도록 수정. try catch 문 안으로 이동.
Change-Id: I6f4988a37a7ffa442d73288c892980b730b5b6f2
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs | ||
---|---|---|
215 | 215 |
try |
216 | 216 |
{ |
217 | 217 |
string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", ""); |
218 |
|
|
218 |
string filename = Path.GetFileName(e.FinalPDFPath); |
|
219 | 219 |
if (!string.IsNullOrEmpty(soapurl)) |
220 | 220 |
{ |
221 | 221 |
//Legacy IF |
222 |
KeyValuePair<bool, string> result = UploadFinal.UploadFinal.UploadFinalPDF(e.FinalPDFPath.Replace(@"\\172.20.121.220\comment3\finalPDF\", ""), e.OriginPDFName, e.FinalPDF, soapurl);
|
|
222 |
KeyValuePair<bool, string> result = UploadFinal.UploadFinal.UploadFinalPDF(filename, e.OriginPDFName, e.FinalPDF, soapurl);
|
|
223 | 223 |
if (result.Key) |
224 | 224 |
{ |
225 | 225 |
SetFinalState(_item.ID, FinalStatus.Success); |
... | ... | |
227 | 227 |
else |
228 | 228 |
{ |
229 | 229 |
SetFinalState(_item.ID, FinalStatus.Error); |
230 |
_Log.Write("Upload error .." + e.FinalPDFPath + ",pdfname:" + e.OriginPDFName);
|
|
230 |
_Log.Write("Upload error .." + filename + ",pdfname:" + e.OriginPDFName);
|
|
231 | 231 |
} |
232 | 232 |
WorkingThread.Remove(_T.First()); |
233 | 233 |
} |
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
1082 | 1082 |
|
1083 | 1083 |
if (File.Exists(pdfFilePath)) |
1084 | 1084 |
{ |
1085 |
|
|
1086 |
FinalPDFPath = new FileInfo(pdfFilePath); |
|
1087 |
|
|
1088 |
///TODO : 복사할 경로를 configuration으로 빼주세요 |
|
1089 |
|
|
1090 |
string pdfmovepath = CommonLib.Common.GetConfigString("PDFMovePath", "URL", ""); |
|
1091 |
File.Move(FinalPDFPath.FullName, pdfmovepath + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1092 |
FinalPDFPath = new FileInfo(pdfmovepath + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1093 |
|
|
1094 | 1085 |
try |
1095 | 1086 |
{ |
1087 |
FinalPDFPath = new FileInfo(pdfFilePath); |
|
1088 |
|
|
1089 |
string pdfmovepath = CommonLib.Common.GetConfigString("PDFMovePath", "URL", ""); |
|
1090 |
string destfilepath = Path.Combine(pdfmovepath,FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1091 |
if (File.Exists(destfilepath)) |
|
1092 |
File.Delete(destfilepath); |
|
1093 |
File.Move(FinalPDFPath.FullName, destfilepath); |
|
1094 |
FinalPDFPath = new FileInfo(destfilepath); |
|
1096 | 1095 |
File.Delete(pdfFilePath); |
1097 | 1096 |
} |
1098 | 1097 |
catch (Exception ex) |
1099 | 1098 |
{ |
1100 |
System.Diagnostics.Debug.Write("삭제 불가" + ex.Message);
|
|
1099 |
SetNotice(finaldata.ID, "File move error: " + ex.ToString());
|
|
1101 | 1100 |
} |
1102 | 1101 |
// |
1103 | 1102 |
|
내보내기 Unified diff