now also processing gz
This commit is contained in:
@@ -4412,7 +4412,11 @@ def workout_upload_api(request):
|
|||||||
rowerform.fields.pop('email')
|
rowerform.fields.pop('email')
|
||||||
try:
|
try:
|
||||||
fstr = request.POST['file']
|
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
|
f2 = 'media/'+f1
|
||||||
copyfile(fstr,f2)
|
copyfile(fstr,f2)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
Reference in New Issue
Block a user