In javascript, how can I detect when the browser brings up the open/save/cancel prompt when loading a file?
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 user开发者_C百科s 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.
You can't! No way, that's it!
精彩评论