From a50694bf6e158810f4dc175cb41377547d8358dc Mon Sep 17 00:00:00 2001 From: aries_ckt <916701291@qq.com> Date: Thu, 29 Jun 2023 17:06:15 +0800 Subject: [PATCH] fix:solve upload file bug solve upload file bug --- pilot/openapi/knowledge/knowledge_controller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pilot/openapi/knowledge/knowledge_controller.py b/pilot/openapi/knowledge/knowledge_controller.py index aec612e9c..26323e098 100644 --- a/pilot/openapi/knowledge/knowledge_controller.py +++ b/pilot/openapi/knowledge/knowledge_controller.py @@ -85,6 +85,8 @@ async def document_upload( print(f"/document/upload params: {space_name}") try: if doc_file: + if not os.path.exists(os.path.join(KNOWLEDGE_UPLOAD_ROOT_PATH, space_name)): + os.makedirs(os.path.join(KNOWLEDGE_UPLOAD_ROOT_PATH, space_name)) with NamedTemporaryFile( dir=os.path.join(KNOWLEDGE_UPLOAD_ROOT_PATH, space_name), delete=False ) as tmp: