From 6d36c38dda3f76f01d077a81edfedd5f0ab11efc Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 7 Oct 2024 11:14:39 +0200 Subject: [PATCH] working uploads --- alkatorapi/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alkatorapi/views.py b/alkatorapi/views.py index 970f25a..52ec62b 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -201,7 +201,7 @@ def upload_files(request): for name, file in request.FILES.items(): print(name) rand = random.randint(0, 99999) - random_name = f'photos/uploads/{rand}{file.name}' + random_name = f'photos/uploads/{rand}_{file.name}' with open(random_name, "wb+") as destination: for chunk in file.chunks(): destination.write(chunk)