I have created a simple app which captured the image and upload to the AWSs3. I want to store those image in my app folder. (I have created this once my app installed). I want to store captured images to that folder instead of the Pictures folder. I am using react-native-image-picker to capture the image.
My code is,
import ImagePicker from 'react-native-image-picker';
import RNFS from 'react-native-fs';
takePic = () => {
const options = {
quality: 1.0,
maxWidth: 100,
maxHeight: 100,
base64: true,
skipProcessing: true
}
const pictureFolder = RNFetchBlob.fs.dirs.SDCardDir+'/Pictures/Text/';
ImagePicker.launchCamera(options,(responce)=>{
this.state.testImage.push({ uri: responce.uri });
const file ={
uri : responce.uri,
name :DeviceInfo.getUniqueID()+'_'+this.props.longitude+'_'+this.props.latitude+'_'+this.state.capturedTime+'_'+this.state.schoolId+'_'+this.state.userId+'_'+this.state.SelectedClass+'_'+this.state.SelectedSection+'_'+this.state.SelectedSubject+'.jpg',
method: 'POST',
//path : pictureFolder+responce.fileName,
path : responce.path,
type : responce.type,
notification: {
enabled: true
}
}
console.log(pictureFolder);
});
(I have updated only part of the code). I tried to mention the destination directory externally using react-native-fs. But I did not.
Can anyone assist me to do so?