Private
Public Access
1
0

now also processing gz

This commit is contained in:
Sander Roosendaal
2020-02-09 18:45:37 +01:00
parent 3909ce3127
commit 0f1269de63

View File

@@ -4412,7 +4412,11 @@ def workout_upload_api(request):
rowerform.fields.pop('email')
try:
fstr = request.POST['file']
f1 = uuid.uuid4().hex[:10]+'-'+time.strftime("%Y%m%d-%H%M%S")+os.path.splitext(fstr)[1]
nn, ext = os.path.splitext(fstr)
if ext== '.gz':
nn, ext2 = os.path.splitext(nn)
ext = ext2+ext
f1 = uuid.uuid4().hex[:10]+'-'+time.strftime("%Y%m%d-%H%M%S")+ext
f2 = 'media/'+f1
copyfile(fstr,f2)
except KeyError: