From be33fe9649586f033c33be861e36ca6d8bb6ec0c Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 7 Oct 2024 11:29:40 +0200 Subject: [PATCH] multiple files probably! --- alkatorapi/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alkatorapi/views.py b/alkatorapi/views.py index e80f370..fdbc305 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: + for file in request.FILES['files']: rand = random.randint(0, 99999) random_name = f'photos/uploads/{rand}_{file.name}' with open(random_name, "wb+") as destination: