mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-12 16:26:12 +01:00
bug file download
This commit is contained in:
@@ -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 import hashPassword
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user