# How to upload mutiple file same in a folder

**URL:** <https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699>\
**Category:** Help\
**Created:** [March 12, 2024, 2:51pm UTC](https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699 "2024-03-12T14:51:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kidkender](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/kidkender/32/8438_2.png) [@Kidkender](https://discuss.ipfs.tech/u/Kidkender)\
**Post date:** [March 12, 2024, 2:51pm UTC](https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699/1 "2024-03-12T14:51:25Z")

</div>

i’m using Kubo RPC /api/v0/add for upload file to ipfs. Currently, I want to be able to upload many files in the same folder to ipfs. I intend to use wrap-with-directory or name the folder the same, but when I push each file, they are all in different folders that I cannot control.

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [March 13, 2024, 4:07pm UTC](https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699/2 "2024-03-13T16:07:57Z")

</div>

You may want to try using the [Mutable File System MFS](https://docs.ipfs.tech/concepts/file-systems/) to create directories and add files.

See the Kubo RPC API methods under `/files`, e.g. [Kubo RPC API | IPFS Docs](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-files-mv)

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [March 13, 2024, 8:45pm UTC](https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699/3 "2024-03-13T20:45:40Z")

</div>

I suppose that you need to upload them in separate /add requests, as otherwise you could upload them all in the same /add request and wrap-with-directory should work. But if you need multiple requests, you can add them first and then move them to the right mutable folder with the MFS operations.

---

<div class="post-metadata">

**Author:** ![mig5](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/mig5/32/8417_2.png) [@mig5](https://discuss.ipfs.tech/u/mig5)\
**Post date:** [March 15, 2024, 1:56am UTC](https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699/4 "2024-03-15T01:56:20Z")

</div>

Here’s how I do it with Python and the Kubo RPC API. No MFS (I’d never even heard of it)

> <https://gist.github.com/mig5/422d5264e591ee7ff22236045b916c1f>

The pertinent bit for constructing the ‘folder’ of files is lines 37 through 50, but note how some of the attributes need to be worked out in advance Lines 17 through 30), such as the size in bytes, etc.

You could probably make it a loop to be more efficient, I just wanted to make the PoC very explicit as to what is happening.

---

<div class="post-metadata">

**Author:** ![Kidkender](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/kidkender/32/8438_2.png) [@Kidkender](https://discuss.ipfs.tech/u/Kidkender)\
**Post date:** [March 15, 2024, 9:26am UTC](https://discuss.ipfs.tech/t/how-to-upload-mutiple-file-same-in-a-folder/17699/6 "2024-03-15T09:26:10Z")

</div>

Thank you , my problem has been solved.
