fix:solve upload file bug

solve upload file bug
This commit is contained in:
aries_ckt 2023-06-29 17:06:15 +08:00
parent b2f1b1319f
commit 92c5e209cf

View File

@ -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: