# How to add multiple files (not a directory) with one API request

**URL:** <https://discuss.ipfs.tech/t/how-to-add-multiple-files-not-a-directory-with-one-api-request/998>\
**Category:** Help\
**Tags:** go-ipfs\
**Created:** [August 24, 2017, 1:48pm UTC](https://discuss.ipfs.tech/t/how-to-add-multiple-files-not-a-directory-with-one-api-request/998 "2017-08-24T13:48:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timothyp](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@timothyp](https://discuss.ipfs.tech/u/timothyp)\
**Post date:** [August 24, 2017, 1:48pm UTC](https://discuss.ipfs.tech/t/how-to-add-multiple-files-not-a-directory-with-one-api-request/998/1 "2017-08-24T13:48:07Z")

</div>

The API docs show the following example for a single file:

```
 curl -F file=@myfile "http://localhost:5001/api/v0/add?recursive=false&quiet=<value>
                       &quieter=<value>&silent=<value>&progress=<value>&trickle=<value>
                       &only-hash=<value>&wrap-with-directory=<value>&hidden=<value>
                       &chunker=<value>&pin=true&raw-leaves=<value>&nocopy=<value>&fscache=<value>"

```

But consider the following command using the CLI:

```
ipfs add -w hello.txt world.txt

```

This outputs the following:

```
ipfs add -w hello.txt world.txt
7 B / 14 B [...] 50.00% 0seadded QmSkYzY65dGXo8q6kjrsj1erH4bLZmyQoHDd8wwoAKpG8V hello.txt
14 B / 14 B [...] 100.00% 0seadded QmfB6vc6ssMvEaMBbG6XGRGhcZYKSqcy8Wgbrcc9rVyGuV world.txt
added QmTNXVpXcVWz52KpMdfFEMuPSmRMBmEkEEq9y4czko6DEy

```

It added the files, outputs the hash for each of them and the hash that wraps them both.

How can I achieve the same result using the API?  
Or can it be done using multiple requests, if so how?

---

<div class="post-metadata">

**Author:** ![cbluth](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/cbluth/32/151_2.png) [@cbluth](https://discuss.ipfs.tech/u/cbluth)\
**Post date:** [April 10, 2018, 10:08pm UTC](https://discuss.ipfs.tech/t/how-to-add-multiple-files-not-a-directory-with-one-api-request/998/2 "2018-04-10T22:08:41Z")

</div>

Try it this way:

```
curl -F "file1=@hello.txt" -F "file2=@world.txt" http://127.0.0.1:5001/api/v0/add?wrap-with-directory=true&arg=file1&arg=file2
```

---

<div class="post-metadata">

**Author:** ![soul](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@soul](https://discuss.ipfs.tech/u/soul)\
**Post date:** [September 10, 2018, 9:16am UTC](https://discuss.ipfs.tech/t/how-to-add-multiple-files-not-a-directory-with-one-api-request/998/3 "2018-09-10T09:16:17Z")

</div>

But, Could you please tell me how to add a directory to ip fs via curl ?  
I can finish it via curl -F “file=@ipfs” “[http://localhost:5001/api/v0/add/?recursive=true&file=&ipfs](http://localhost:5001/api/v0/add/?recursive=true&file=&ipfs)”
