我创建了一个简单的应用程序来捕获图像并上传到 AWSs3。我想将这些图像存储在我的应用程序文件夹中。(我在安装我的应用程序后创建了这个)。我想将捕获的图像存储到该文件夹而不是图片文件夹。我正在使用 react-native-image-picker 来捕获图像。
我的代码是,
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);
});
(我只更新了部分代码)。我尝试使用 react-native-fs 在外部提及目标目录。但我没有。
任何人都可以帮助我这样做吗?