4👍
✅
In order to get it to download, you’ll need to pass the right headers, and set the actual page location to the new address, as if you were changing page properly.
I don’t think you can initiate a download via an AJAX call. It won’t change page anyway if it starts a download.
Either put the parameters as a GET call, or create a form and submit it.
window.location = '/actions/?action=download&item=' + current;
2👍
You need to navigate to that URL by setting window.location
to trigger a normal download.
You cannot trigger a download via AJAX.
- [Django]-Django-tables2 – how to use a custom filter in a TemplateColumn
- [Django]-SESSION_COOKIE_HTTPONLY = True not working in Django:
Source:stackexchange.com