tusd icon indicating copy to clipboard operation
tusd copied to clipboard

Can I specify bucket custom path for the upload?

Open anyght opened this issue 4 years ago • 8 comments

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?

anyght avatar Nov 22 '21 10:11 anyght

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.

Acconut avatar Nov 22 '21 12:11 Acconut

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 ?

anyght avatar Nov 22 '21 12:11 anyght

No, the prefix must be specific when starting tusd and cannot be changed at runtime. In addition, there can only be one prefix.

Acconut avatar Nov 22 '21 12:11 Acconut

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 ?

fbossiere avatar Nov 22 '21 13:11 fbossiere

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 avatar Nov 22 '21 14:11 Acconut

@Acconut would you be interested in a PR that parameterizes prefix?

sdhull avatar Mar 15 '22 18:03 sdhull

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.

Acconut avatar Mar 17 '22 15:03 Acconut

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.

Acconut avatar Jun 09 '23 08:06 Acconut