rn-fetch-blob
rn-fetch-blob copied to clipboard
Getting the following error Write error: ssl=0xc32e7440: I/O error during system call, Broken pipe
I'm getting the following error Write error: ssl=0xc32e7440: I/O error during system call, Broken pipe when trying to uplaod an image to AWS S3 Bucket. It happens only when image size is greater or equal to 6MB.
react native version: 0.51 react native fetch blob version: 0.10.8 OS: Android Oreo
Here is the code snippet(If it's helpful)
import RNFetchBlob from 'react-native-fetch-blob';
import { API } from 'aws-amplify';
export const getSignedUrl = (key, metaData) => (
new Promise<{ url: string}>((resolve, reject) => {
let apiName = "GetSignedURL";
let path = '/';
let options = { body: { key: `public/${key}`, metaData }};
API.post(apiName, path, options)
.then(res => resolve(res))
.catch(err => reject(err));
})
)
const generalisedUploadImage = (key, metaData, imageLocalPath) => (
new Promise((resolve, reject) => {
getSignedUrl(key, metaData)
.then(res => {
console.log(res);
RNFetchBlob.fetch('PUT', res.url,
{
'Content-Type': 'image/jpeg',
'x-amz-acl': 'bucket-owner-full-control',
'x-amz-meta-timestamp': metaData.timestamp
},
RNFetchBlob.wrap(imageLocalPath)
)
.then(res => { console.log(res); resolve(res) })
.catch(err => { console.log("reject", err); reject(err); })
})
.catch(err => {
console.log("err", err);
reject(err);
})
})
);
I suspect the problem with the RNFetchBlob.wrap method. Is there any size limit for upload ?
TIA
@developercode1 Have you managed to figure it out? I'm also having this issue
I got same issue when uploading a video file. Another one is that the S3 object is not created even though everything seems to succeed (no error).
Getting the same issue on marshmallow (23), pie (28) and Q beta 2 while uploading a image file of appx 1 Mb. Any solution ? react-native version: 0.59.2
Getting the same issue on marshmallow (23), pie (28) and Q beta 2 while uploading a image file of appx 1 Mb. Any solution ? react-native version: 0.59.2
Works as of now, the issue was probably on the server side limiting the amount of data sent on the request
I'm still getting this with blobs that I create from blob.slice