IE不允许上传文件,如果不是keybord点击输入type = file

use*_*858 1 html xhtml jquery internet-explorer input-type-file

我有一个要求,我需要从另一个按钮触发输入[type = file]并上传文件.此输入[type = file]是用于浏览用户想要上载的文件的弹出窗口.此窗口成功打开,但在上传文件时,它会给我SCRIPT5: Access is Denied error.我无法用输入[type = file]替换假按钮,有没有办法可以触发点击输入[type = file],即使它不是来自键盘点击并仍然上传文件.根据我的研究,除非我们通过键盘点击触发input-type = file,否则IE不允许上传文件.

var uploadConfig ={
    init: function(){
        $('input#fileUpld_input').livequery("click",function() {
        });
    },
    open: function() {
        $('input#fileUpld_input').trigger('click');
    },
    upload: function(){
        $('.start').click();
    }
Run Code Online (Sandbox Code Playgroud)

浏览器

<input type="file" id="fileUpld_input" name="fileUpld_input" class="fileUpld">
Run Code Online (Sandbox Code Playgroud)

srt*_*ver 5

使用其他答案中显示的代码为我工作:使用 JSFiddle

<input type="file" id="fileUpld_input" name="fileUpld_input" class="fileUpld">
Run Code Online (Sandbox Code Playgroud)

我有同样的问题,但确定它与IE不是代码.花了太多时间试图解决我的代码中的错误; 我解雇了我的笔记本电脑,无法复制它.最终重启和重启IE修复了这个问题.