diff --git a/app/app.py b/app/app.py index d7d22b3..1c511dc 100644 --- a/app/app.py +++ b/app/app.py @@ -1383,7 +1383,12 @@ async def api_files_full(path_b64: str, request: Request): if not _is_safe_path(UPLOAD_ROOT, file_path) or not os.path.isfile(file_path): return Response(status_code=404) - return FileResponse(file_path) + mime_type, _ = mimetypes.guess_type(file_path) + disposition = "attachment" + if mime_type and (mime_type.startswith(('image/', 'video/', 'audio/', 'text/')) or mime_type == 'application/pdf'): + disposition = "inline" + + return FileResponse(file_path, content_disposition_type=disposition, filename=os.path.basename(rel_path)) @app.get("/api/files/zip/{path_b64}")