Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Generate s3 bucket key from DB records #2688

Open
single-stop-rj opened this issue May 10, 2021 · 0 comments
Open

Generate s3 bucket key from DB records #2688

single-stop-rj opened this issue May 10, 2021 · 0 comments

Comments

@single-stop-rj
Copy link

Hello. I am looking for a way to generate the s3 key strictly from the DB record.

Is this possible?

In my config file, I have

...
path: ":class/:attachment/:id_partition/:hash/:style/:filename",
...

I am building an ETL process, and I would like to scope it to just running off the data in the DB, and not have to run a process on the old server.

The example DB record is.

1,a,Note,some_filename.pdf,application/pdf,55945(some file size),some_file_name.pdf, 1,Owner::User,created_at_time, updated_at_time

and the S3 path is something like

attachments/files/000/000/011/14574b3c24afc433440aa46ab42be4044e4dd492/original/some_file.pdf

How would I be able to generate the proper key with only the database record?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant