title: How can I get folder path/directory in react js
body: <p>What I am trying to achieve is to open a directory (like &quot;File Explorer&quot; on windows ) and select path to a folder. Not to a file!</p>
  <p>I have tried webkitdirectory, directory attribute with type=&quot;file&quot; but doesn't work.</p>
  <pre><code>&lt;input type=&quot;file&quot; webkitdirectory mozdirectory directory /&gt;
  </code></pre>
  <p>Would appreciate to see some simple example how can this be done.</p>
  <p><strong>EDITED:</strong></p>
  <p>I just need to return the path to the folder and not files under the folder.
  <strong>Example: C:\Documents\Test</strong>  - this is correct</p>
  <p>C:\Documents\Test\someFile.csv - incorrect</p>
  <p><a href="https://i.stack.imgur.com/1jl4v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1jl4v.png" alt="enter image description here" /></a></p>