Код: Выделить всё
file_location = f"files/{uploaded_file.filename}"
with open(file_location, "wb+") as file_object:
file_object.write(uploaded_file.file.read())
Код: Выделить всё
import shutil
file_location = f"files/{uploaded_file.filename}"
with open(file_location, "wb+") as file_object:
shutil.copyfileobj(uploaded_file.file, file_object)
Подробнее здесь: https://stackoverflow.com/questions/677 ... hutil-copy
Мобильная версия