diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-26 18:09:18 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-26 18:09:18 +0900 |
| commit | 8547034e6d82e4d1184f35af2dbff67180d89dc8 (patch) | |
| tree | 2e1835040f39adc7d0c410a108ebb558f9971a8b /app/api | |
| parent | 3131dce1f0c90d960f53bd384045b41023064bc4 (diff) | |
(김준회) dolce: 동기화 기능 추가, 로컬 다운로드, 삭제 추가, 동기화 dialog 개선 등
Diffstat (limited to 'app/api')
| -rw-r--r-- | app/api/dolce/download/route.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/api/dolce/download/route.ts b/app/api/dolce/download/route.ts index 9d5eb601..94fe35b4 100644 --- a/app/api/dolce/download/route.ts +++ b/app/api/dolce/download/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from "next/server"; -import { downloadDolceFile } from "@/lib/dolce/actions"; +import { downloadDolceFile, downloadLocalFile } from "@/lib/dolce-v2/actions"; export async function POST(request: NextRequest) { try { @@ -15,6 +15,19 @@ export async function POST(request: NextRequest) { console.log("[DOLCE Download API] 요청:", { fileId, userId, fileName }); + // 로컬 파일 다운로드 처리 + if (String(fileId).startsWith("LOCAL_")) { + const { buffer, fileName: localFileName } = await downloadLocalFile(fileId); + + return new NextResponse(buffer, { + headers: { + "Content-Type": "application/octet-stream", + "Content-Disposition": `attachment; filename*=UTF-8''${encodeURIComponent(localFileName)}`, + "Content-Length": buffer.byteLength.toString(), + }, + }); + } + // DOLCE API를 통해 파일 다운로드 const { blob, fileName: downloadFileName } = await downloadDolceFile({ fileId, |
