JavaScript Cancel Dialog Event

I have a file:

<input type=file id=file onchange='foo(this.files)'/> 

The function 'foo' is called only when the user selects a file in the file download dialog box and clicks "OK". Is there any event that will be fired when the user clicks the cancel button in the dialog box? HTML5-only solutions are fine.

+7
source share
1 answer

I think the best way, if you can change your code a bit, is to add plugins to add files, for example:

http://swfupload.org/

or

http://www.uploadify.com

they are more common, I will work with the first, and I had no problems.

This will not do what you want, but you can add files to the queue and then cancel them, and you can capture this event ...

I know that this is not what you were looking for, but it is the best solution I can give you.

Good luck I hope I helped you.

-one
source

All Articles