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

Error :- read failed: EBADF (Bad file descriptor) when upload image. #96

Open
Ektasahusahu opened this issue Apr 17, 2020 · 2 comments
Open

Comments

@Ektasahusahu
Copy link

image object contain uri path :

**{
name:"6ca129ac-8a07-4838-b141-cd25126b250b"
type:"image/jpeg"
uri:"content://com.vider/external_files/Pictures/images/image-647ec492-7149-4f13-822a-4e95dc053c9e.jpg"
}**

complete source code:
const options = { keyPrefix: storagePath, bucket: 'wigbucket', region: 'us-east-1', accessKey: accessKey, secretKey: secretKey, successActionStatus: 201, // dirName: 'dev/profiles', // contentType: file.type, }; const fileObject = { uri: file.uri,//file://${file.path}`,
name: uuidv4(),
type: file.type,
};

console.log('fileObject======>ekta', fileObject, options);
return  RNS3.put(file, options)
.then(response => {
  if (response.status !== 201)
    throw new Error("Failed to upload image to S3");
  else {
    console.log(
      "Successfully uploaded image to s3. s3 bucket url: ",
      response.body.postResponse.location
    );
  }
})
.catch(error => {
  console.log(error);
});`
@rajeevnodzon
Copy link

rajeevnodzon commented Jun 22, 2020

Got the same issue on Android sdk - 22. read failed: EBADF (Bad file descriptor) while uploading jpg. Spent a full day to verify every thing, from permissions on mobile to permission on aws, but still getting the error.

@rajeevnodzon
Copy link

Seems like this package doesn't works with RN > 60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants