Configure Tus Endpoint Dynamically

Hi, I need to upload file to different path based on user input. I already trying reinitialized uppy on user input. But the endpoint still didn’t change.

window.InitializeUppy = function () {
const TUS_ENDPOINT = ‘http:localhost/files/’ + $(“#user_input”).val();

const uppyDashboard = new Uppy({ logger: debugLogger })
    .use(Dashboard, {
        inline: true,
        target: "#uppy"
    })
    .use(DropTarget, {
        target: document.body
    })
    .use(Tus, { endpoint: TUS_ENDPOINT, limit: 6 });

}

Is there any way to configure tus endpoint dynamically based user input?

Directly putting user input into the endpoint like that can be a security vulnerability.

This is an XY problem, what is the problem you’re trying to solve? It’s probably better to send along metadata for all files (with meta option) or per file (setFileMeta or onBeforeFileAdded) and do something with it in your tus server.

Thanks, I am using metadata now