diff --git a/filemanager/static/filemanager/js/fileManager.js b/filemanager/static/filemanager/js/fileManager.js index 725224dbb..19e175118 100755 --- a/filemanager/static/filemanager/js/fileManager.js +++ b/filemanager/static/filemanager/js/fileManager.js @@ -1479,7 +1479,6 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader, // Download files $scope.downloadFile = function () { - url = "/filemanager/downloadFile"; var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0]; window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL; diff --git a/filemanager/views.py b/filemanager/views.py index d33899d04..6edc740ea 100755 --- a/filemanager/views.py +++ b/filemanager/views.py @@ -66,7 +66,9 @@ def downloadFile(request): admin = Administrator.objects.get(pk=userID) import urllib.parse - fileToDownload = urllib.parse.unquote(request.GET.get('fileToDownload')) + fileToDownload = request.build_absolute_uri().split('fileToDownload')[1][1:] + fileToDownload = urllib.parse.unquote(fileToDownload) + domainName = request.GET.get('domainName') currentACL = ACLManager.loadedACL(userID) diff --git a/plogical/test.py b/plogical/test.py index 8278a4ee9..e69de29bb 100755 --- a/plogical/test.py +++ b/plogical/test.py @@ -1,3 +0,0 @@ -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