Aws-sdk-android: Getting error : Unable to calculate MD5 hash - EACCES (Permission denied)"

Created on 21 Aug 2020  路  1Comment  路  Source: aws-amplify/aws-sdk-android

Describe the bug
Precondition :

  1. Android SDK Version - 29
  2. Removed android:requestLegacyExternalStorage="true" from manifest file
  3. Added within Manifest file

android.permission.WRITE_EXTERNAL_STORAGE and android.permission.READ_EXTERNAL_STORAGE

Now When we are trying to upload the image, it is throwing error saying that
"Unable to calculate MD5 hash: /storage/emulated/0/WhatsApp/Media/WhatsApp Images/**.jpg: open failed: EACCES (Permission denied)"

To Reproduce
Your code
File file = new File(localFilePath);
mTransferUtility.upload(s3Credential.bucketName, s3Credential.dirName + "/" + uploadInfo.fileName, file);

Expected behaviour
It should upload the file irrespective of Android SDK version

Environment Information (please complete the following information):

Additional context
Should we create a temporary file [using ParcelFileDescriptor] from original path and pass the file object to upload method or library should have provision to pass Uri object and it will take care of all the necessary things for uploading?

Bug S3

Most helpful comment

Yeah for now you'd need to create a Temporary file - adding support for the stream is a feature request that's definitely on our radar.

>All comments

Yeah for now you'd need to create a Temporary file - adding support for the stream is a feature request that's definitely on our radar.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mockturtl picture mockturtl  路  4Comments

PikkaPikkachu picture PikkaPikkachu  路  4Comments

logo17 picture logo17  路  4Comments

zgao67 picture zgao67  路  4Comments

nsadiq-radpits picture nsadiq-radpits  路  3Comments