Skip to content

@tus/s3-store: add object prefixing #457

@Murderlon

Description

@Murderlon

Prefixing can be used to create a pseudo-directory structure in the bucket.

tusd supports this with a hardcoded ObjectPrefix option:

https://github.com/tus/tusd/blob/b4ffdf43f034099ee46437271de2ff98c1f52397/pkg/s3store/s3store.go#L987-L994

in @tus/s3-store we have partKey where this could be supported:

private partKey(id: string, isIncomplete = false) {
if (isIncomplete) {
id += '.part'
}
// TODO: introduce ObjectPrefixing for parts and incomplete parts.
// ObjectPrefix is prepended to the name of each S3 object that is created
// to store uploaded files. It can be used to create a pseudo-directory
// structure in the bucket, e.g. "path/to/my/uploads".
return id
}

However it might be more flexible have a function getObjectPrefix (upload: Upload) => string so it can be done dynamically based on metadata?

cc @fenos

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