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;
|
return cookieValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var fileManager = angular.module('fileManager', ['angularFileUpload']);
|
var fileManager = angular.module('fileManager', ['angularFileUpload']);
|
||||||
|
|
||||||
fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
|
fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
|
||||||
@@ -1481,10 +1480,9 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
|||||||
|
|
||||||
$scope.downloadFile = function () {
|
$scope.downloadFile = function () {
|
||||||
|
|
||||||
url = "/filemanager/downloadFile/";
|
url = "/filemanager/downloadFile";
|
||||||
var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0];
|
var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0];
|
||||||
|
window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL;
|
||||||
window.location.href = url + '?domainName=' + domainName + '?downloadURL=' + downloadURL;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ def downloadFile(request):
|
|||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
fileToDownload = '/home/cyberpanel.xyz/public_html/hello.txt'
|
fileToDownload = request.GET.get('fileToDownload')
|
||||||
domainName = 'cyberpanel.xyz'
|
domainName = request.GET.get('domainName')
|
||||||
|
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
@@ -94,8 +94,6 @@ def downloadFile(request):
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadErrorJson('permissionsChanged', 0)
|
return ACLManager.loadErrorJson('permissionsChanged', 0)
|
||||||
|
|
||||||
logging.CyberCPLogFileWriter.writeToFile('test')
|
|
||||||
|
|
||||||
response = HttpResponse(content_type='application/force-download')
|
response = HttpResponse(content_type='application/force-download')
|
||||||
response['Content-Disposition'] = 'attachment; filename=%s' % (fileToDownload.split('/')[-1])
|
response['Content-Disposition'] = 'attachment; filename=%s' % (fileToDownload.split('/')[-1])
|
||||||
response['X-LiteSpeed-Location'] = '%s' % (fileToDownload)
|
response['X-LiteSpeed-Location'] = '%s' % (fileToDownload)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from plogical import hashPassword
|
|||||||
from plogical.acl import ACLManager
|
from plogical.acl import ACLManager
|
||||||
from packages.models import Package
|
from packages.models import Package
|
||||||
from baseTemplate.models import version
|
from baseTemplate.models import version
|
||||||
from CLManager.models import CLPackages
|
|
||||||
|
|
||||||
if not os.geteuid() == 0:
|
if not os.geteuid() == 0:
|
||||||
sys.exit("\nOnly root can run this script\n")
|
sys.exit("\nOnly root can run this script\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user