You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2022. It is now read-only.
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:
Setting the Content-Type for proper delivery from the cloud to other clients. Example with the thumbnail service given above.
Adding versioning or owner info to the stored file using metadata mechanisms available for all cloud storages.
Avoiding potential security issues, if attacker uploads a executable file, where an image is expected, and then it is stored in cloud with wrong Content-Type (default application/octet-stream instead of image/*).
This is a feature of all cloud storages, deemed needed or useful by all cloud product teams.
@RomainLanz I stuck with wrong content-type too. May be I miss something, but I upload data to aws s3 by this code disk.put(storagePath, fs.createReadStream(file.path)). As result I get on s3 content-type: 'application/octet-stream', so i couldn't deliver these files from s3 by s3-website.
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 extendingContentResponse
to:Possibly also aliasing StatResponse to FileMetadata?
The text was updated successfully, but these errors were encountered: