Skip to content Skip to sidebar Skip to footer

IE Doesn't Allow To Upload The File, If It Is Not Keybord Click For Input Type=file

I have a requirement where i need to trigger the input[type=file] from another button and upload the files. This input[type=file] is a popup window for browsing the file which the

Solution 1:

Use the code shown in the other answer worked for me: working JSFiddle

<input type="file" id="fileUpld_input" name="fileUpld_input" class="fileUpld">

I had the same problem, but determined that it was with IE not the code. After spending waaay too much time trying to sort out the error in my code; I fired up my laptop and could not replicate it. Eventually a reboot and restart of IE fixed the issue.


Solution 2:

is there a way i can trigger click on input[type=file] even it is not from keyboard click.

try this: http://jsfiddle.net/RASG/FkdCm/

HTML

<input type="file" id="fileUpld_input" name="fileUpld_input" class="fileUpld">

<br>
<br>
<br>

<button id="theotherbutton">try me</button>

JS

$('#theotherbutton').click(function() { $('#fileUpld_input').click() })

Tested with IE 9 and FF 16


Post a Comment for "IE Doesn't Allow To Upload The File, If It Is Not Keybord Click For Input Type=file"