mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix bug about fetching file from minio (#574)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -328,12 +328,12 @@ def rename():
|
||||
# @login_required
|
||||
def get(file_id):
|
||||
try:
|
||||
e, doc = FileService.get_by_id(file_id)
|
||||
e, file = FileService.get_by_id(file_id)
|
||||
if not e:
|
||||
return get_data_error_result(retmsg="Document not found!")
|
||||
|
||||
response = flask.make_response(MINIO.get(doc.parent_id, doc.location))
|
||||
ext = re.search(r"\.([^.]+)$", doc.name)
|
||||
response = flask.make_response(MINIO.get(file.parent_id, file.location))
|
||||
ext = re.search(r"\.([^.]+)$", file.name)
|
||||
if ext:
|
||||
if doc.type == FileType.VISUAL.value:
|
||||
response.headers.set('Content-Type', 'image/%s' % ext.group(1))
|
||||
|
||||
Reference in New Issue
Block a user