react-native-aws3
react-native-aws3 copied to clipboard
Not able to create Dynamic sub keyPrefix
Not able to create Dynamic sub keyPrefix while uploading Images???
Hi My requirement is to make my unique deviceId as Prefix and upload pictures in a folder which is prefix
For example my deviceId is '3ac.....'. so I need to create a folder name as '3ac....' and add pictures in them.
I acheived it by storing deviceId in some variable .
this.state.deviceId= '3ac....' and pass this variable in RN3 ie...
const options = {
keyPrefix: this.state.deviceId+ ('/'),
bucket : "your bucket name",
region :"your region",
accessKey:"your Access Key",
secretKey :"your secret Key",
successActionStatus :201,
contentType:"image/png",
}
This will find out one solution for changing the folder name or prefix (here unique deviceID) dynamically..
Hope this will helps you