Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading a file using Amplify.Storage.uploadFile doesn't appear to support specifying a checksum algorithm. #3802

Open
2 tasks
sbelbin opened this issue Aug 7, 2024 · 2 comments
Labels
feature-request Request a new feature storage Issues related to the Storage category transferred This issue was transferred from another Amplify project

Comments

@sbelbin
Copy link

sbelbin commented Aug 7, 2024

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

Storage

Is this related to another service?

No response

Describe the feature you'd like to request

When using the Amplify.Storage.uploadFile function to upload a file, this message appear at the start of each upload. This occurs when implementing a Swift app that is running on a iPad that is running iOS 17.5.1.

info S3Client : [Logging] No checksum provided! Skipping flexible checksums workflow...

While the file uploads correctly, it's preferable to be able to configure the checksum algorithm as to ensure that contents delivered into the AWS S3 bucket matches the checksum of the original file.

Describe the solution you'd like

The AWS SDK Swift CreateMultipartUploadRequest supports specifying the checksum algorithm, see below:

CreateMultipartUploadRequest.builder() .bucket(BUCKET) .key(FILE_NAME) .checksumAlgorithm(ChecksumAlgorithm.SHA256) .build();

My request is for AWS Amplify Storage support this.

My preference is being able to provide a parameter/option to the uploadFile, uploadData and other functions which transfer data to/from the AWS S3 bucket.

Alternative solutions is to define the checksum algorithm as part of the AWS Amplify backend definition (storage/resource.ts) or being able to configure the Amplify.Storage instance to a checksum algorithm.

Describe alternatives you've considered

As mentioned, while I could use AWS Amplify trap door to get the S3Client instance to the AWS S3 bucket and to use CreateMultipartUploadRequest as to specify the checksum algorithm.

However, my mindset is that AWS Amplify Storage was conceived to simplify transferring of data and implementing a multi-part upload would be excessive.

Additional context

My opinion on the matter is that a checksum algorithm should be applied by default, since it a good practice for ensuring data transfer was done correctly.

For situations where it's not wanted, such as it introduces a performance overhead, then those applications could opt-out.

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@sbelbin sbelbin added the pending-triage Issue is pending triage label Aug 7, 2024
@cwomack cwomack self-assigned this Aug 7, 2024
@cwomack cwomack added storage Issues related to the Storage category feature-request Request a new feature and removed pending-triage Issue is pending triage labels Aug 7, 2024
@cwomack
Copy link
Member

cwomack commented Aug 7, 2024

Hello, @sbelbin and thanks for opening this issue. Since this is related to a Swift app, I'll actually transfer this over the the amplify-swift repository to ensure they have this feature request tracked as well. We currently have issue aws-amplify/amplify-js#11776 that is tracking this for the JS side.

@cwomack cwomack transferred this issue from aws-amplify/amplify-js Aug 7, 2024
@cwomack cwomack removed their assignment Aug 7, 2024
@cwomack cwomack added the transferred This issue was transferred from another Amplify project label Aug 7, 2024
@thisisabhash
Copy link
Member

Thank you for posting the feature request. Our team would take a look and post updates here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature storage Issues related to the Storage category transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

3 participants