From b7901de2f3073e26b1a00e49eabebddaf7d22cec Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 7 Oct 2024 11:36:25 +0200 Subject: [PATCH] multiple files probably already --- alkatorapi/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alkatorapi/views.py b/alkatorapi/views.py index fdbc305..f22795c 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -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: