diff --git a/app/Http/Controllers/System/AiVoiceRecordingController.php b/app/Http/Controllers/System/AiVoiceRecordingController.php index 0e605222..2eafcd16 100644 --- a/app/Http/Controllers/System/AiVoiceRecordingController.php +++ b/app/Http/Controllers/System/AiVoiceRecordingController.php @@ -229,7 +229,7 @@ public function status(int $id): JsonResponse /** * GCS 음성파일 다운로드 */ - public function download(int $id): Response|JsonResponse + public function download(Request $request, int $id): Response|JsonResponse { $recording = AiVoiceRecording::find($id); @@ -252,6 +252,7 @@ public function download(int $id): Response|JsonResponse // 파일 확장자 추출 $extension = pathinfo($recording->audio_file_path, PATHINFO_EXTENSION) ?: 'webm'; + $mimeType = 'audio/'.$extension; // 파일명 생성 (한글 제목 지원) $title = $recording->title ?: 'recording'; @@ -259,8 +260,12 @@ public function download(int $id): Response|JsonResponse $filename = $safeTitle.'.'.$extension; $encodedFilename = rawurlencode($filename); + $disposition = $request->query('inline') ? 'inline' : 'attachment'; + return response($content) - ->header('Content-Type', 'audio/'.$extension) - ->header('Content-Disposition', "attachment; filename=\"{$encodedFilename}\"; filename*=UTF-8''{$encodedFilename}"); + ->header('Content-Type', $mimeType) + ->header('Content-Length', strlen($content)) + ->header('Accept-Ranges', 'bytes') + ->header('Content-Disposition', "{$disposition}; filename=\"{$encodedFilename}\"; filename*=UTF-8''{$encodedFilename}"); } } diff --git a/resources/views/system/ai-voice-recording/index.blade.php b/resources/views/system/ai-voice-recording/index.blade.php index 2a70102a..8945b836 100644 --- a/resources/views/system/ai-voice-recording/index.blade.php +++ b/resources/views/system/ai-voice-recording/index.blade.php @@ -755,6 +755,23 @@ className={`flex-1 text-xs font-medium py-1.5 rounded-md transition-colors ${tab )} + {/* 오디오 플레이어 */} + {data.audio_file_path && ( +
+
+ + + + + +
+
+ )} + {/* Body */}
{data.status === 'PROCESSING' && (