From dddefd7e444d7aaa9ccf848468921ee90e88d503 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 25 Apr 2020 11:25:45 +0500 Subject: [PATCH] decode url --- filemanager/views.py | 3 ++- plogical/test.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/filemanager/views.py b/filemanager/views.py index cf91e7d42..d33899d04 100755 --- a/filemanager/views.py +++ b/filemanager/views.py @@ -64,8 +64,9 @@ def downloadFile(request): try: userID = request.session['userID'] admin = Administrator.objects.get(pk=userID) + import urllib.parse - fileToDownload = request.GET.get('fileToDownload') + fileToDownload = urllib.parse.unquote(request.GET.get('fileToDownload')) domainName = request.GET.get('domainName') currentACL = ACLManager.loadedACL(userID) diff --git a/plogical/test.py b/plogical/test.py index e69de29bb..8278a4ee9 100755 --- a/plogical/test.py +++ b/plogical/test.py @@ -0,0 +1,3 @@ +import urllib.parse +encodedStr = 'ville.laprairie.qc.ca&fileToDownload=/home/ville.laprairie.qc.ca/public_html/app/uploads/2019/05/2019-05-16_Terre-contamine%CC%81e-sur-Goyer-150x150.jpg' +print(urllib.parse.unquote(encodedStr)) \ No newline at end of file