multiple files probably already

This commit is contained in:
Martin Quarda 2024-10-07 11:36:25 +02:00
parent be33fe9649
commit b7901de2f3

View File

@ -209,7 +209,7 @@ def photos(request):
@csrf_exempt
def upload_files(request):
for file in request.FILES['files']:
for file in request.FILES.getlist('files'):
rand = random.randint(0, 99999)
random_name = f'photos/uploads/{rand}_{file.name}'
with open(random_name, "wb+") as destination: