# How to specify folder when using Uppy with Tus?

**URL:** <https://community.transloadit.com/t/how-to-specify-folder-when-using-uppy-with-tus/17395>\
**Category:** Uppy\
**Created:** [December 16, 2024, 9:22am UTC](https://community.transloadit.com/t/how-to-specify-folder-when-using-uppy-with-tus/17395 "2024-12-16T09:22:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![empz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/empz/32/1269_2.png) [@empz](https://community.transloadit.com/u/empz)\
**Post date:** [December 16, 2024, 9:22am UTC](https://community.transloadit.com/t/how-to-specify-folder-when-using-uppy-with-tus/17395/1 "2024-12-16T09:22:11Z")

</div>

I’m setting up Uppy.js (React) with the Supabase TUS server. It’s working but file ends up in the root of the storage. I want to be able to specify a folder (based on the current user id) so that all file uploads for a particular user are always into its own folder.

Is this possible? If so, how?

---

<div class="post-metadata">

**Author:** ![Merlijn](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/merlijn/32/1382_2.png) [@Merlijn](https://community.transloadit.com/u/Merlijn)\
**Post date:** [December 16, 2024, 11:04am UTC](https://community.transloadit.com/t/how-to-specify-folder-when-using-uppy-with-tus/17395/2 "2024-12-16T11:04:57Z")

</div>

Supabase uses tus-node-server which does support that but it’s a server-side feature so I think you have to look at their docs to figure this out, not ours.

---

<div class="post-metadata">

**Author:** ![empz](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/empz/32/1269_2.png) [@empz](https://community.transloadit.com/u/empz)\
**Post date:** [December 16, 2024, 1:29pm UTC](https://community.transloadit.com/t/how-to-specify-folder-when-using-uppy-with-tus/17395/3 "2024-12-16T13:29:09Z")

</div>

Found it.

It’s needed to set the right objectName within the Uppy file metadata on file added event.

```auto
.on("file-added", async (file) => {
            // Attach metadata to each file, including bucket name and content type
            file.meta = {
              ...file.meta,
              bucketName, // Bucket specified by the user of the hook
              objectName: `${someParentFolder}/${file.name}`, // Use file name as object name
              contentType: file.type, // Set content type based on file MIME type
            };

```
