It works on other browsers but not for IE:
javascript:
function getFile(){
document.getElementById("upfile").click();
}
function sub(){
document.getElementById("myf").submit();
}
body:
<div id="yourBtn" onclick="getFile()">Upload File<img src="img/upload.jpg></div>
<iframe name="upload_iframe" src="upload_file.php" style="display:block;"></iframe>
<form method="post" enctype="multipart/form-data" action="upload_file.php" name="myForm" id="myf" target="upload_iframe">
<input id="upfile" type="file" name="file" value="" onchange="sub(this)" />
</form>
I know that there are a lot of ways to submit form (I used jQuery as well) but it still doesn't work on IE8 and I don't know why. Any ideas? Thanks!