Open
Description
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);
});`
Metadata
Metadata
Assignees
Labels
No labels