diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-07 17:39:36 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-07 17:39:36 +0900 |
| commit | 1363913352722a03e051b15297f72bf16d80106f (patch) | |
| tree | 1f4b1228ff171bda515deb95dcdde1f4484ced8e /lib/vendor-document-list/enhanced-document-service.ts | |
| parent | ba8cd44a0ed2c613a5f2cee06bfc9bd0f61f21c7 (diff) | |
(김준회) 돌체 업로드 MIME 타입 검증 문제 확장자로 처리
Diffstat (limited to 'lib/vendor-document-list/enhanced-document-service.ts')
| -rw-r--r-- | lib/vendor-document-list/enhanced-document-service.ts | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/vendor-document-list/enhanced-document-service.ts b/lib/vendor-document-list/enhanced-document-service.ts index 2a81ddec..bb497f3b 100644 --- a/lib/vendor-document-list/enhanced-document-service.ts +++ b/lib/vendor-document-list/enhanced-document-service.ts @@ -1609,7 +1609,21 @@ export async function getDocumentDetails(documentId: number) { const docNumber = formData.get(`docNumber_${i}`) as string const revision = formData.get(`revision_${i}`) as string - if (!file || !docNumber) continue + // 디버깅 로그 추가 + console.log(`📋 파일 ${i} 처리:`, { + fileName: file?.name, + fileType: file?.type, + fileSize: file?.size, + docNumber, + revision, + hasFile: !!file, + hasDocNumber: !!docNumber + }) + + if (!file || !docNumber) { + console.warn(`⚠️ 파일 ${i} 스킵: file=${!!file}, docNumber=${!!docNumber}`) + continue + } if (!fileGroups.has(docNumber)) { fileGroups.set(docNumber, []) @@ -1746,6 +1760,14 @@ export async function getDocumentDetails(documentId: number) { } // 파일 저장 + console.log(`💾 파일 저장 시작:`, { + fileName: fileInfo.file.name, + fileType: fileInfo.file.type, + fileSize: fileInfo.file.size, + docNumber, + revision: fileInfo.revision + }) + const saveResult = await saveFile({ file: fileInfo.file, directory: `documents/${existingDoc.id}/revisions/${revisionId}`, @@ -1754,8 +1776,17 @@ export async function getDocumentDetails(documentId: number) { }) if (!saveResult.success) { + console.error(`❌ 파일 저장 실패:`, { + fileName: fileInfo.file.name, + error: saveResult.error + }) throw new Error(saveResult.error || "파일 저장 실패") } + + console.log(`✅ 파일 저장 성공:`, { + fileName: fileInfo.file.name, + publicPath: saveResult.publicPath + }) // 첨부파일 정보 저장 const [newAttachment] = await db.insert(documentAttachments).values({ |
