:<INPUT id="upLoad" type="file"  name="file1"    runat="server" onpropertychange="document.all.aaaa.src=this.value" 
onkeydown="return false" oncontextmenu="return false">function funcOnerr(){
  document.getElementsByName("file1")[0].value="";
}

解决方案 »

  1.   

    onerror="document.getElementById("upLoad").innerHTML="<input id=upLoad type=file...>"
      

  2.   

    <input type=file name=ttt>  
    <input type=button onclick="ttt.select();document.execCommand('Delete');"  value=清除file框的内容>  
    IE only
      

  3.   

    清空file框的内容IE要降安全级别,所以还是重新组装一个吧
    <div id="div1">
    <input name=haha type=file></div>
    <input name=qingkong type=button value="清空" onclick="document.getElementById('div1').innerHTML='<input name=haha type=file>'">
      

  4.   

    出于安全的考虑,type=file的value属性是只读的。用meizz的方法在ie里可以清除。
      

  5.   

    <input type=file name=ttt>  
    <input type=button onclick="ttt.outerHTML+='';"  value=清除file框的内容>
      

  6.   

    JK_10000(JK) 这个才是最好,不需要降低安全
      

  7.   

    document.getElementById("upload").outerHTML += '';//清空IE的
    document.getElementById("upload").value = "";//可以清空火狐的
    两个写一起,可以执行起来,且达到预期效果
    至于其他浏览器,没有试过,不清楚