Is there an easy way to make the fileupload work w

2019-08-10 07:23发布

问题:

In IE11 file upload button of ZK is not working.

I got few replies, It says after updating ZK it will fix the problem.

But we can't update ZK, So in this scenario is there any way to work out this problem any how.

回答1:

If you can't upgrade ZK then you can try to "downgrade" the IE using "X-UA-Compatible" either as meta-tag or as a response header

here an example using the meta tag:

<?meta http-equiv="X-UA-Compatible" content="IE=10" ?>
<zk>
  <fileupload label="upload" onUpload="alert(event.getMedia().getName())"/>
</zk>

and what it looks like in the browser (in the IE dev tools F12 you can check if the meta tag had an effect, you'll see that IE falls back to version 10):

http://screencast.com/t/ftheLA9Ud8



回答2:

Finally I got the Solution. AS IE 11 having problem to attach event for listening to open File chooser. You just manually add the listener.

<button id="browsebtn"  upload="true,maxsize=-1" visible="true" sclass="text">
<attribute w:name="doMouseDown_">
            function (evt) {

            }
            </attribute>
</button>


回答3:

Its simple and weird, However what I found is make the parent component as draggable="true"

<row draggable="true">
    <div style="text-align : right;">
        <label value="Image File:" />
    </div>
    <fileupload id="fileUpload" label="Upload" tooltiptext="Click to upload image file."/>
</row>

Now suddenly you will see your fileupload button in ZK started working correctly for IE11 as well.