fix graph info error and upload error

This commit is contained in:
Wenjie Zhang 2025-04-01 18:37:30 +08:00
parent b512b9ed22
commit 2d7c3b32d6
2 changed files with 5 additions and 4 deletions

View File

@ -127,6 +127,7 @@ async def upload_file(
basename, ext = os.path.splitext(file.filename) basename, ext = os.path.splitext(file.filename)
filename = f"{basename}_{hashstr(basename, 4, with_salt=True)}{ext}".lower() filename = f"{basename}_{hashstr(basename, 4, with_salt=True)}{ext}".lower()
file_path = os.path.join(upload_dir, filename) file_path = os.path.join(upload_dir, filename)
os.makedirs(upload_dir, exist_ok=True)
with open(file_path, "wb") as buffer: with open(file_path, "wb") as buffer:
buffer.write(await file.read()) buffer.write(await file.read())