I have an anchor that when clicked, downloads a file that first needs to be generated. This takes a few seconds, so to the user it seems like nothing is happening. I want to display a loading animation while waiting for the first byte (after which the browser shows the download progress), but I can't figure how to do that.
I don't want to perform an ajax request and register for the progress events, because I want the browser's download manager to handle the actual download.
Is there a way to be notified when the download is actually starting?