bug file download

This commit is contained in:
Usman Nasir
2020-01-16 13:55:06 +05:00
parent 7949ffb96b
commit 139f4ef861
3 changed files with 4 additions and 9 deletions

View File

@@ -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)