mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-26 08:04:24 +08:00
fix bug of get file (#746)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
69b7c61498
commit
aa03dfa453
@ -349,12 +349,8 @@ def get(doc_id):
|
|||||||
if not e:
|
if not e:
|
||||||
return get_data_error_result(retmsg="Document not found!")
|
return get_data_error_result(retmsg="Document not found!")
|
||||||
|
|
||||||
informs = File2DocumentService.get_by_document_id(doc_id)
|
b,n = File2DocumentService.get_minio_address(doc_id=doc_id)
|
||||||
if not informs:
|
response = flask.make_response(MINIO.get(b, n))
|
||||||
response = flask.make_response(MINIO.get(doc.kb_id, doc.location))
|
|
||||||
else:
|
|
||||||
e, file = FileService.get_by_id(informs[0].file_id)
|
|
||||||
response = flask.make_response(MINIO.get(file.parent_id, doc.location))
|
|
||||||
|
|
||||||
ext = re.search(r"\.([^.]+)$", doc.name)
|
ext = re.search(r"\.([^.]+)$", doc.name)
|
||||||
if ext:
|
if ext:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user