In javascript, how can I detect when the browser brings up the open/save/cancel prompt when loading a file?
If possible, is it the same for all browsers?
I’m trying to fix a problem with users clicking a download button, being impatient and clicking it again, and again which is taxing our servers. I tried just hiding the button while the file is processed, but the icon will come back before the open/save/cancel prompt shows up.
The code goes something like this:
…
users clicks button,
button hides,
external process gets the file,
button appears …
You can’t.
How the browser deals with a requested resource – open it, start an external application, offer a “save” dialog – is outside of what you can control using JavaScript.