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

Generate s3 bucket key from DB records #2688

@single-stop-rj

Description

@single-stop-rj

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions