Skip to content
Permalink
Browse files
bug file download
  • Loading branch information
usmannasir committed Jan 16, 2020
1 parent 7949ffb commit 139f4ef861b0957307a3db8f89f4a539a4cc16e7
Showing with 4 additions and 9 deletions.
  1. +2 −4 filemanager/static/filemanager/js/fileManager.js
  2. +2 −4 filemanager/views.py
  3. +0 −1 plogical/adminPass.py
@@ -14,7 +14,6 @@ function getCookie(name) {
return cookieValue;
}


var fileManager = angular.module('fileManager', ['angularFileUpload']);

fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
@@ -1481,10 +1480,9 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,

$scope.downloadFile = function () {

url = "/filemanager/downloadFile/";
url = "/filemanager/downloadFile";
var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0];

window.location.href = url + '?domainName=' + domainName + '?downloadURL=' + downloadURL;
window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL;
};


@@ -84,8 +84,8 @@ def downloadFile(request):
userID = request.session['userID']
admin = Administrator.objects.get(pk=userID)

fileToDownload = '/home/cyberpanel.xyz/public_html/hello.txt'
domainName = 'cyberpanel.xyz'
fileToDownload = request.GET.get('fileToDownload')
domainName = request.GET.get('domainName')

currentACL = ACLManager.loadedACL(userID)

@@ -94,8 +94,6 @@ def downloadFile(request):
else:
return ACLManager.loadErrorJson('permissionsChanged', 0)

logging.CyberCPLogFileWriter.writeToFile('test')

response = HttpResponse(content_type='application/force-download')
response['Content-Disposition'] = 'attachment; filename=%s' % (fileToDownload.split('/')[-1])
response['X-LiteSpeed-Location'] = '%s' % (fileToDownload)
@@ -11,7 +11,6 @@
from plogical.acl import ACLManager
from packages.models import Package
from baseTemplate.models import version
from CLManager.models import CLPackages

if not os.geteuid() == 0:
sys.exit("\nOnly root can run this script\n")

0 comments on commit 139f4ef

Please sign in to comment.