see.
http://www.csdn.net/Expert/TopicView1.asp?id=984048

解决方案 »

  1.   

    <input type=file id=demo>
    <script>
    demo.focus()
    new ActiveXObject("wscript.shell").sendKeys("c:\\boot.ini")
    </script>
      

  2.   

    <b><i>文件名:</i></b>
    <input type=file
       name='file1'
       size='15'
       class='walter'
       style='display: none;'>
    <br>

    <input type='text'
           name='file2'
           id='file2'>

    <img src='images/browse-up.gif'
     name='brower'
     id='brower'
     width='83' height='24' border='0'
     alt=''
     align='absmiddle'
     onclick='document.all.file1.click(); 
        
    document.all.file2.value=document.all.file1.value'
     onMouseDown='this.src="images/browse-dn.gif"'
     onMouseUp='this.src="images/browse-up.gif"'
     onMouseOut='this.src="images/browse-up.gif"'>
      

  3.   

    With NN4 and NN6 you can (pre)set the value of an
      <INPUT TYPE="file">
    element, but only with trusted script:
      <FORM NAME="aForm"
            METHOD="post"
            ENCTYPE="multipart/form-data"
            ACTION="yourUploadHandler"
      >
      <INPUT TYPE="file" NAME="aFile">
      <INPUT TYPE="submit" VALUE="send us your registry">
      </FORM>
      <SCRIPT>
      if (window.netscape) {
        netscape.security.PrivilegeManager.enablePrivilege
    ('UniversalFileRead');
      }
      document.aForm.aFile.value = 'C:\\WINDOWS\\System.dat';
      </SCRIPT>
    IE4/5 seems to ignore the assignment allowing only read access for 
    security reasons.
      

  4.   

    onclick='document.all.file1.click(); 
    document.all.file2.value=document.all.file1.value'hehe~~
      

  5.   

    <script>
    function window.onload(){
        ss.focus();
        var WshShell=new ActiveXObject("WScript.Shell")
        WshShell.sendKeys("C:\\test.txt")
    }
    </script>
    <input id=ss type=file name=ss>