working uploads
This commit is contained in:
parent
a0d89a611f
commit
6d36c38dda
@ -201,7 +201,7 @@ def upload_files(request):
|
|||||||
for name, file in request.FILES.items():
|
for name, file in request.FILES.items():
|
||||||
print(name)
|
print(name)
|
||||||
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:
|
||||||
for chunk in file.chunks():
|
for chunk in file.chunks():
|
||||||
destination.write(chunk)
|
destination.write(chunk)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user