Skip to content
This repository was archived by the owner on Dec 7, 2022. It is now read-only.
This repository was archived by the owner on Dec 7, 2022. It is now read-only.

[Feature Request] Support for setting metadata on file upload, and downloading it along with file contents. #125

@OJezu

Description

@OJezu

I would like to add support for setting metadata, like Content-Type (as third argument to put), and include the file metadata along the file content in response from get* methods (Azure returns it anyway, I suspect other storage providers do that too).

I need that in my application, so that our thumbnail service can properly recognize file formats. There are also some security implications if Content-Type of uploaded file must be ignored (as is always set to default value).

I propose adding third argument to put: put(location: string, content: Buffer | Readable | string, metadata?: FileMetadata) and extending ContentResponse to:

export interface ContentResponse<ContentType> extends Response {
	content: ContentType;
        metadata: FileMetadata;
}

Possibly also aliasing StatResponse to FileMetadata?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions