multiple files probably already
This commit is contained in:
parent
be33fe9649
commit
b7901de2f3
@ -209,7 +209,7 @@ def photos(request):
|
|||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
def upload_files(request):
|
def upload_files(request):
|
||||||
for file in request.FILES['files']:
|
for file in request.FILES.getlist('files'):
|
||||||
rand = random.randint(0, 99999)
|
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:
|
with open(random_name, "wb+") as destination:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user