Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing GCS/S3 prefix with pre-create. #488

Closed
mlnj opened this issue Jun 8, 2021 · 3 comments
Closed

Changing GCS/S3 prefix with pre-create. #488

mlnj opened this issue Jun 8, 2021 · 3 comments
Labels

Comments

@mlnj
Copy link

mlnj commented Jun 8, 2021

Question
Is it possible to decide a prefix for a file on the pre-create hook?

Using Uppy.js with tusd docker containers to upload to Google Storage or S3.
Trying to save files into a structure like:

<bucket>/<uuid>/<file>

Setup details
Please provide following details, if applicable to your situation:

Operating System: Linux
Used tusd version: latest docker (sha256:8fd45989c674d3cb919c1bcfc7f3096bf98c14684885df546166ea04aae6b0ce)
Used tusd data storage: Ggoogle Storage
Used tusd configuration: [gcs-bucket test_bucket, -hooks-enabled-events]
Used tus client library: uppy.js
@mlnj mlnj added the question label Jun 8, 2021
@Acconut
Copy link
Member

Acconut commented Jun 9, 2021

No, this is unfortunately currently not possible. The prefix (or destination path) cannot be influenced by the pre-create hook (for any kind of storage inside tusd). We are considering adding such a functionality in the future since some people ask for it, but we have no plans for that in the near future.

@mlnj mlnj closed this as completed Jun 15, 2021
@Akkarine
Copy link

Akkarine commented Mar 16, 2022

It would be useful for cases, when you serve uploaded files not through tusd, but with S3 with CDN. It also reslove #574.
And it would be greate to combine with #333.

@Acconut
Copy link
Member

Acconut commented Mar 17, 2022

I can see how this would be useful but we still do not have any plans to implement this on our own. We are open to PRs but this is not priority. If you want a per-upload prefix for the objects on GCS/S3, you can rename/move the object on the cloud storage once the upload is completed.

Akkarine added a commit to Akkarine/tusd that referenced this issue Mar 19, 2022
possibly fix for tus#488
- bumped alpine runtime in dockerfile
- get rid of [unmaintained](bmizerany/pat#17) routing library bmizerany/pat
- fixed CORS request test (status must be just 404, not 405, consequences of bmizerany/pat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants