first commit
This commit is contained in:
25
code/system/apis/vdes/chat/common.py
Normal file
25
code/system/apis/vdes/chat/common.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from ninja import Router
|
||||
from ninja import Router, UploadedFile, File
|
||||
import os
|
||||
from fuadmin import settings
|
||||
|
||||
router = Router()
|
||||
|
||||
# @router.get("/uploadFile")
|
||||
# def upload_file(request, files: list[UploadedFile] = File(...)):
|
||||
# file_list = []
|
||||
# upload_dir = os.path.join(settings.BASE_DIR, 'upload')
|
||||
# os.makedirs(upload_dir, exist_ok=True)
|
||||
|
||||
# for file in files:
|
||||
# new_path = os.path.join(upload_dir, file.name)
|
||||
# with open(new_path, 'wb+') as destination:
|
||||
# for chunk in file.chunks():
|
||||
# destination.write(chunk)
|
||||
# file_list.append({
|
||||
# 'name': file.name,
|
||||
# 'path': new_path,
|
||||
# 'size': file.size
|
||||
# })
|
||||
|
||||
# return file_list
|
||||
Reference in New Issue
Block a user