decode url

This commit is contained in:
Usman Nasir
2020-04-25 11:25:45 +05:00
parent e7e3f2b863
commit dddefd7e44
2 changed files with 5 additions and 1 deletions

View File

@@ -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)

View File

@@ -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))