mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: video activites issue
This commit is contained in:
parent
137a909347
commit
86645fa81a
5 changed files with 38 additions and 7 deletions
|
|
@ -4,6 +4,11 @@ import os
|
|||
async def upload_video(video_file, activity_id):
|
||||
contents = video_file.file.read()
|
||||
video_format = video_file.filename.split(".")[-1]
|
||||
|
||||
if not os.path.exists("content/uploads/video"):
|
||||
# create folder
|
||||
os.mkdir("content/uploads/video")
|
||||
|
||||
# create folder
|
||||
os.mkdir(f"content/uploads/video/{activity_id}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue