From 29a670522ae1147a926f7747a856e012095c6461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 7 Feb 2026 14:20:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EC=9D=8C=EC=84=B1=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=ED=95=9C=EA=B8=80=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EB=B0=8F=20=ED=99=95=EC=9E=A5?= =?UTF-8?q?=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Str::slug()이 한글을 제거하는 문제 수정 - 한글 파일명 그대로 유지 (파일시스템 금지문자만 치환) - RFC 5987 filename*=UTF-8'' 헤더로 브라우저 호환성 확보 - 다운로드 파일명 예시: 무제 음성녹음.webm Co-Authored-By: Claude Opus 4.6 --- .../Controllers/System/AiVoiceRecordingController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/System/AiVoiceRecordingController.php b/app/Http/Controllers/System/AiVoiceRecordingController.php index 62bf0b18..0e605222 100644 --- a/app/Http/Controllers/System/AiVoiceRecordingController.php +++ b/app/Http/Controllers/System/AiVoiceRecordingController.php @@ -253,11 +253,14 @@ public function download(int $id): Response|JsonResponse // 파일 확장자 추출 $extension = pathinfo($recording->audio_file_path, PATHINFO_EXTENSION) ?: 'webm'; - // 파일명 생성 (제목 기반, URL 안전하게) - $filename = Str::slug($recording->title ?: 'recording').'.'. $extension; + // 파일명 생성 (한글 제목 지원) + $title = $recording->title ?: 'recording'; + $safeTitle = preg_replace('/[\/\\\\:*?"<>|]/', '_', $title); + $filename = $safeTitle.'.'.$extension; + $encodedFilename = rawurlencode($filename); return response($content) ->header('Content-Type', 'audio/'.$extension) - ->header('Content-Disposition', 'attachment; filename="'.$filename.'"'); + ->header('Content-Disposition', "attachment; filename=\"{$encodedFilename}\"; filename*=UTF-8''{$encodedFilename}"); } }