Skip to content
Permalink
Browse files
bug fix: file download
  • Loading branch information
usmannasir committed Apr 25, 2020
1 parent dddefd7 commit 1ab847f28dae78de1e1de5ace5cff4aa4b1b8029
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
@@ -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;
@@ -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)
@@ -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))

0 comments on commit 1ab847f

Please sign in to comment.