tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
2.95k stars 467 forks source link

How to specify a path based on the information in MetaData #1024

Open dogger123 opened 8 months ago

dogger123 commented 8 months ago

Question I want to specify a upload path based on the information in MetaData. The current programme is that I need to specify a fixed path first, but my requirement is to upload to a different path based on the requested content each time. How can I achieve this?

Setup details

dogger123 commented 8 months ago

Since I'm using ceph storage, it's sometimes very time-consuming to move across pvc, and I wanted to skip this step of the operation

Acconut commented 7 months ago

This is not fully possible right now. You can use the pre-create hook and set ChangeFileInfo.ID to a custom file name (https://github.com/tus/tusd/blob/main/docs/hooks.md#hook-requests-and-responses). This ID will then be the file name where tusd saves the data and will also be part of the upload URL. However, the ID must not contain a slash for now, so you cannot use subfolders: https://github.com/tus/tusd/issues/1030

We hope to improve support for this in the future.