We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The text was updated successfully, but these errors were encountered:
Merge pull request joltup#237 from ZaycevDmitriy/fix_bug_#179_Illegal…
f2d7d8f
…_callback_invocation Fix bug Illegal callback invocation from native module
No branches or pull requests
"rn-fetch-blob": "^0.10.13",
"react-native": "0.55.4",
_uploadImg(images){
// 创建上传的请求头,使用fetch-blob必须要遵循name,data的格式,要不然就不成功。
let body = images.map(i => {
let PATH = Platform.OS!=='ios'?i.path.replace('file:///',''):i.path;
return {name: 'file', filename: 'jpg', data: RNFetchBlob.wrap(PATH)};
});
RNFetchBlob.fetch('POST',global.httpUrl+'/files',{
// 上传图片要设置Header
'Content-Type' : 'multipart/form-data',
'token': global.unionid
},body)
// .uploadProgress({ interval : 250 },(written, total) => {
// // 查找进度
// // console.log('查找进度',written/total)
// })
// .progress({ count : 10 },(received, total) => {
// // 上传进度打印
// // console.log('上传进度打印',received/total)
// this.props.loadingProgress(received/total)
// })
.then((response)=> {
this.props.addImageUrl(response.data)
})
.catch((error)=>{
// 错误信息
console.error(error);
Alert.alert('上传失败,请重试!');
});
}
The text was updated successfully, but these errors were encountered: