extension should always be lowercase
This commit is contained in:
parent
90d717769c
commit
4fae41c463
1 changed files with 3 additions and 2 deletions
|
@ -388,6 +388,7 @@ def upload(request):
|
||||||
else:
|
else:
|
||||||
file = None
|
file = None
|
||||||
name, extension = request.POST['filename'].rsplit('.', 1)
|
name, extension = request.POST['filename'].rsplit('.', 1)
|
||||||
|
extension = extension.lower()
|
||||||
response = json_response(status=400, text='this request requires POST')
|
response = json_response(status=400, text='this request requires POST')
|
||||||
if 'chunk' in request.FILES:
|
if 'chunk' in request.FILES:
|
||||||
if file.editable(request.user):
|
if file.editable(request.user):
|
||||||
|
@ -399,7 +400,7 @@ def upload(request):
|
||||||
#init upload
|
#init upload
|
||||||
else:
|
else:
|
||||||
if not file:
|
if not file:
|
||||||
file = models.Document(user=request.user, extension=extension)
|
file = models.Document(user=request.user)
|
||||||
file.data['title'] = name
|
file.data['title'] = name
|
||||||
file.extension = extension
|
file.extension = extension
|
||||||
file.uploading = True
|
file.uploading = True
|
||||||
|
@ -411,7 +412,7 @@ def upload(request):
|
||||||
file.file.delete()
|
file.file.delete()
|
||||||
file.uploading = True
|
file.uploading = True
|
||||||
name, extension = request.POST['filename'].rsplit('.', 1)
|
name, extension = request.POST['filename'].rsplit('.', 1)
|
||||||
file.extension = extension.lower()
|
file.extension = extension
|
||||||
file.width = -1
|
file.width = -1
|
||||||
file.pages = -1
|
file.pages = -1
|
||||||
file.save()
|
file.save()
|
||||||
|
|
Loading…
Reference in a new issue