Open / Save As Dialog Box

Jquery:

Is there a way to catch an event that fires when the browser opens the Open / Save As dialog box? Open / Save dialog box http://qpack.orcanos.com/helpcenter/Images/openSave.png

I need to do something when the dialog box is shown.

+4
source share
6 answers

Impossible. The browser handles this specifically so that web hackers cannot force you to download the virus, which would be much easier for them if this happened in javascript.

+3
source

A I know that there is no definite way to detect when this window appears. Try adding a click handler to the download button / icon. Or, as I solved this in my project, I added asynchronous logic. when the document was generated, I passed the "succes" to the client, and then the JS code did some logic that I needed.

+1
source

I don’t know what I know.

I assume this will be open when you click on some element on the page. The best thing is to capture this event.

Given your anchor:

<a id="MyLink" href="MyDoc.doc"> 

A simple mouse click will capture this event before the text above appears.

 $(document).ready(function(){ $("#MyLink").click(function() { alert($(this).length); }); }); 
+1
source

As far as I know, there is no way to do this.

0
source

Is the file type you are checking always the same? If so, you can do something like

 $("a").click(function(e){ var extension = $(this).attr("href").substr($(this).attr("src").lastIndexOf(".")); if ((extension && /^(zip|vbd)$/.test(extension))){ alert("Hi now you can do whatever you needed to do!"); } }); 

Please note: no e.preventDefault () as you still want the invitation to appear? Guess?

Check box for checking file extension

0
source

You can check OpenSave:

http://www.gieson.com/Library/projects/utilities/opensave/

This is not part of jQuery, but you can easily integrate it. They seem to be using Flash to solve the problem.

0
source

All Articles