def download_file(self, request, *args, **kwargs):
path = r'C:\Users\Administrator\Desktop\test.txt'
file = open(path, 'rb')
response = FileResponse(file)
response['Content-Type'] = 'application/octet-stream'
filename=quote('test.txt'.encode('utf-8'))
response['Content-Disposition'] = 'attachment;filename="text.txt"'
return response