I am redirecting user using window.location.href
to a page that forces a file download using the following headers:
Content-Description: File Transfer
Content-Disposition: attachment; filename="foo"
As a result, user is not taken to the page, though asked if he wishes to proceed downloading the file.
How do I tell when the response from the server is received?
The user flow that I am trying to achieve:
- Display loader.
- "redirect" the user (with
window.location.href
). - Hide loader when response is received.