-
Notifications
You must be signed in to change notification settings - Fork 1.6k
RNFetchBlob.fetchBlobForm failed to create request body #437
Comments
@jstoebel , I'd like to know how is the image's URI look like, perhaps it's caused by #287 . |
@wkh237 I took a look at
Is the problem something to do with the repeated |
@jstoebel , perhaps that's exactly what we're going to do in #387, please try to stripe |
@wkh237 Were you able to track down what is the root cause of the issue? I would like to help out by making a PR to fix this issue. |
Because IOS file system does not recognize the |
I'm having the same issue and removing file:// from the URL does nothing and I'm still getting the same error let cleanUri = string_.ltrim(newPhoto.uri, "file:///");
console.log(cleanUri) RNFetchBlob.fetch('POST', 'https://api.claudia.constructioncloud.io/teams/' +selectedTeam.id+ '/photos', {
Authorization : `JWT ${accessToken}`,
'Content-Type' : undefined, //'multipart/form-data',
}, [
// part file from storage
{ name : 'file', filename : 'avatar-foo.png', type:'image/jpg', data: RNFetchBlob.wrap(cleanUri)},
]).then((resp) => {
console.log(resp);
}).catch((err) => {
console.log(err);
}) |
I was able to debug this I had the following setting for options under image picker // Options for photos and videos
const options = {
title: 'Select',
noData:true,
mediaType:'mixed',
storageOptions: {
skipBackup: true,
path: 'construction cloud'
}
};
|
I have this same issue |
@Nealyang What issue? I see two issues above and both seem to have been addressed. Did you try what helped the others? |
@AlmogRnD you replaced |
FYI: for me PATCH works perfect but not POST. So I think bug is inside the package |
striping the file:// fixed my issues, but I think this should be patched on library level, any news on this? |
Read the README? :-) |
That works for me, Thanks. |
i solved with string.replace('file://', '') |
React-Native: 0.46.3
RNFB: 0.10.6
I am trying to upload a selected image from the camera roll using react-native-image-picker. The following works fine on Android but on ios I get warning:
Error: RNFetchBlob.fetchBlobForm failed to create request body
. Any idea what I'm doing wrong?The text was updated successfully, but these errors were encountered: