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
On debugging the MD5 implementation, could observe that reader.readAsDataURL(blob) returns base64 string and we are encoding it with utf-8 which is causing the error,
Expected behavior
Amplify Library should auto-calculate ContentMD5 value automatically for all types of files selected
@sushpatg, thank you for opening this issue and the associated PR #13433! We'll review both internally and follow up with any further questions/suggestions we have.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Storage
Amplify Version
v6
Amplify Categories
storage
Backend
Amplify CLI
Environment information
Describe the bug
Currently when we enable "isObjectLockEnabled" to true. Amplify Library auto-calculates MD5 header: Code Reference
However, this calculation is only working when passing String data. When we select file using the following documented code it throws BadDigest error.
On debugging the MD5 implementation, could observe that reader.readAsDataURL(blob) returns base64 string and we are encoding it with utf-8 which is causing the error,
Expected behavior
Amplify Library should auto-calculate ContentMD5 value automatically for all types of files selected
Reproduction steps
uploadData call
Code Snippet
Log output
aws-exports.js
{
"aws_project_region": "us-east-1",
"aws_cognito_identity_pool_id": "xxxxxxxx",
"aws_cognito_region": "us-east-1",
"aws_user_pools_id": "xxxxxxxx,
"aws_user_pools_web_client_id": "xxxxxxxx",
"oauth": {},
"aws_cognito_username_attributes": [],
"aws_cognito_social_providers": [],
"aws_cognito_signup_attributes": [
"EMAIL"
],
"aws_cognito_mfa_configuration": "OFF",
"aws_cognito_mfa_types": [
"SMS"
],
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"aws_cognito_verification_mechanisms": [
"EMAIL"
],
"aws_dynamodb_all_tables_region": "us-east-1",
"aws_dynamodb_table_schemas": [
{
"tableName": "dynamo2f297001-dev",
"region": "us-east-1"
}
],
"aws_user_files_s3_bucket": "fxxxxxxxx",
"aws_user_files_s3_bucket_region": "us-east-1",
"aws_appsync_graphqlEndpoint": "xxxxxxxx",
"aws_appsync_region": "us-east-1",
"aws_appsync_authenticationType": "API_KEY",
"aws_appsync_apiKey": "xxxxxxxx"
}
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: