We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 130ce2e + 5e69c6b commit 67a70bfCopy full SHA for 67a70bf
backend/app/routers/files.py
@@ -349,8 +349,12 @@ async def download_file(
349
content = fs.get_object(settings.MINIO_BUCKET_NAME, bytes_file_id)
350
351
# Get content type & open file stream
352
+ media_type = file.content_type.content_type
353
+ if media_type == "N/A":
354
+ media_type = "application/octet-stream"
355
response = StreamingResponse(
- content.stream(settings.MINIO_UPLOAD_CHUNK_SIZE)
356
+ content.stream(settings.MINIO_UPLOAD_CHUNK_SIZE),
357
+ media_type=media_type,
358
)
359
response.headers["Content-Disposition"] = (
360
"attachment; filename=%s" % file.name
0 commit comments