From 8547034e6d82e4d1184f35af2dbff67180d89dc8 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Wed, 26 Nov 2025 18:09:18 +0900 Subject: (김준회) dolce: 동기화 기능 추가, 로컬 다운로드, 삭제 추가, 동기화 dialog 개선 등 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/dolce/download/route.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app/api') 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, -- cgit v1.2.3