# Adding directory to IPFS from browser

**URL:** <https://discuss.ipfs.tech/t/adding-directory-to-ipfs-from-browser/13308>\
**Category:** Uncategorized\
**Created:** [January 29, 2022, 1:13am UTC](https://discuss.ipfs.tech/t/adding-directory-to-ipfs-from-browser/13308 "2022-01-29T01:13:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwarshack](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jwarshack/32/5963_2.png) [@jwarshack](https://discuss.ipfs.tech/u/jwarshack)\
**Post date:** [January 29, 2022, 1:13am UTC](https://discuss.ipfs.tech/t/adding-directory-to-ipfs-from-browser/13308/1 "2022-01-29T01:13:40Z")

</div>

Hello. I am wondering if it is possible to add a directory that is inputted by a user. I know it is possible to add local directories.

Here is some code I am working with:

```auto
function App() {

  async function handleFile(e) {
    const files = e.target.files

    for await (const file of client.addAll(files)) {
        console.log(file.path)
    }

  }
  return (
    <div className="App">
        <input type="file" webkitdirectory directory multiple accept="audio/*" onChange={handleFile}/>            
    </div>
  );
}

```

This just adds each file individually and returns the cid. I want to wrap all files in a directory and return the cid of the directory.
