chemdt
chemdt

Reputation: 3

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 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 ...

Upvotes: 0

Views: 761

Answers (2)

Marco Demaio
Marco Demaio

Reputation: 34427

You can't! No way, that's it!

Upvotes: 0

Pekka
Pekka

Reputation: 449733

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.

Upvotes: 2

Related Questions