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}"); } }