<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="1.php">
<input type="file" id="file"name="file" style="display:none"/>
<input type="button" name="button" value="" onclick="javascript:openBrowse();" />
<input type="text" id="filename"/>
</form>
</body>
<script type="text/javascript">
function openBrowse(){
var ie=navigator.appName=="Microsoft Internet Explorer" ? true : false;
if(ie){
document.getElementById("file").click();
document.getElementById("filename").value=document.getElementById("file").value;
}else{
var a=document.createEvent("MouseEvents");//FF 
a.initEvent("click", true, true);  
document.getElementById("file").dispatchEvent(a);
}
}
</script>
</html>