Requirement Description:
In the image system, the user wants to prompt the operation that does not meet the replacement conditions and interrupt the upload operation when clicking the replacement file.
The original operation of the system is to open the file upload window, select the file to submit, and then prompt that it does not meet the replacement conditions
In order to solve the above user needs and meet the IE8 and above browser, finally found the following solutions
Ie11 and above browsers:
openFileSelectDialogInterception method can be added in
IE8 stream-v1.js uploads the processing logic of creating objects for opening the local file upload window, which is relatively complicated
_evenHandlerThe trigger event can be monitored in. To open a local file window, it needs to be triggered when you click. Therefore, you can do some logical processing when you move the mouse in. Here, set the display property of the object to none, and then the event of the object will not take effect
At this time, click the replace file button, and the event bound to the object parent element will take effect. A user prompt will pop up, and the display property of object will be set to ” or block