tweedegolf / storage-abstraction

Provides an abstraction layer for interacting with a storage; the storage can be local or in the cloud.
MIT License
110 stars 18 forks source link

Request to update on src/AdapterAmazonS3.ts #60

Closed seng-js closed 8 months ago

seng-js commented 9 months ago

https://github.com/tweedegolf/storage-abstraction/blob/313fdb621b04921a3f26ee2635601f3d8e0f4c5a/src/AdapterAmazonS3.ts#L275

Hello everyone, base on document of Amazon S3 below, I think we need to update options to the same level Bucket.. https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/PutObjectCommand/ We got some error for upload files on Amazon S3, seem like required content image type but we cannot put it because the options will not the same level Bucket

 const input = {
    Bucket: params.bucketName,
    Key: params.targetPath,
    Body: fileData,
    options: { ...params.options },
  };

  To

  const input = {
    Bucket: params.bucketName,
    Key: params.targetPath,
    Body: fileData,
    ...params.options,
  };

Thank you, let me know if I'm correct or something I need to check more.

abudaan commented 8 months ago

The adapter for Amazon S3 has been updated to 1.0.14

I have added your suggestion, thanks!