title: <input type='file'> IE Gives full path, FF gives only filename (or directory browse)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1676035/cant-get-the-complete-address-while-uploading-a-file">Can&rsquo;t get the complete address while uploading a file</a>  </p>
  </blockquote>
  
  <p>I need the full path.
  I'm trying to give the functionality of local bookmarks, ie user wants to access <code>c:\MyStuff\Myfile.xls</code> on their local Pc.
  How do I save/get that value without having to make a tutorial help page on how to cut and paste <code>c:\MyStuff\Myfile.xls</code> .</p>
  
  <p>The below code works in IE7.
  I understand the point about it being a security issue, but I don't need to save their choice or even use enctype/multiform, or even submit anything, i just need to get the path they selected.</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;script language="JavaScript" type="text/javascript"&gt;
  &lt;!--
  vic=0;
  document.write('&lt;style&gt; .debug {VISIBILITY: visible; POSITION: absolute; TOP: 500px; z-Index:100; }&lt;/style&gt;')
  &lt;!----&gt;
  &lt;/script&gt;
  
  Select a file from directory then save the path&lt;br&gt;
  &lt;input type="file" id="dir" value="dir" style="width:0px;" &gt;
  &lt;input type="button" value="Save Path" onclick="javascript:SavePath();" &gt;
  
  &lt;script language="JavaScript" type="text/javascript"&gt;
  &lt;!-- works on ie8 not ff.
  function SavePath(){
  if (document.getElementById('dir').value==''){
    alert('Select a file from the directory');
    return;
  }
  Path=document.getElementById('dir').value.substring(0,document.getElementById('dir').value.lastIndexOf('\\'));
  alert('variable Path='+Path+'\\ ');
  }
  //--&gt;
  &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt; 
  </code></pre>