title: How to get full path name of uploaded folder using javascript?
body: <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;body&gt;
  &lt;div align="center" style="width:800px" &gt;
  
  LocalShare:
  
  &lt;input type="file" id="FileUpload" onchange="selectFolder(event)" webkitdirectory mozdirectory multiple /&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;p id="demo1"&gt;&lt;/p&gt;
  &lt;script&gt;
  function selectFolder(e) {
      var txt = "";
      var theFiles = e.target.files;
      var relativePath = theFiles[0].webkitdirectory;
      var relativePath = theFiles[0].webkitRelativePath;
      var x = document.getElementById("FileUpload").value;
      document.getElementById("demo").innerHTML = x;
      document.getElementById("demo1").innerHTML = relativePath;
      var folder = relativePath.split("/");
      alert(folder[0]);
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Output of the above code is:</p>
  
  <blockquote>
    <p>C:\fakepath\filename</p>
    
    <p>foldername</p>
  </blockquote>
  
  <p>Here it is displaying folder name and path name. It is taking default value as "fakepath" but I need to find out exact path!</p>