Can I specify bucket custom path for the upload?
Question
Hello there,
I want to upload an objet to GCS bucket with a specified path, with tusd server connected to my bucket with the command tusd -gcs-bucket=my_bucket.
When I upload an objet, this objet name is a generate value on the bucket.
So I want to get something like My_bucket/custom_path/filename or My_bucket/custom_path/generate_id for the upload filename
How can I specify the name of the upload?
You can control the folder on GCS, in which the upload will be saved using -gcs-object-prefix. The filename will always be generated by tusd and cannot be controlled by you. If you want to have a specific filename on GCS, you must rename/move the object after the upload is complete.
it is possible to have multiple prefix ?
With -gcs-object-prefix The file path will be static, there is some config to have it dynamic ?
No, the prefix must be specific when starting tusd and cannot be changed at runtime. In addition, there can only be one prefix.
Interesting, thank you. And is there a way to deploy TusD which allows a greater flexibility regarding the prefix or the file naming ? Maybe we have to use another version of TUS ?
If you want fully customized paths, we recommend to use tusd to upload file in one folder and them move/rename them according to your preferences. This way you have the stability of tusd but the flexibility you want.
@Acconut would you be interested in a PR that parameterizes prefix?
We are always interested in PRs :) However, it would make sense to first discussion the actual feature proposal and its implementation in a separate issue.
Parameterizing the object key for s3store might be possible in the future using https://github.com/tus/tusd/pull/962, although this is not implemented yet.