when try to upload file it through error socket is closed
Got this as well
Try to remove the protocol file:// from the path on Android. It worked for me:
const res = await RNFS.uploadFiles({
toUrl,
method: 'POST',
files: [
{
filename,
filepath: Platform.select({
android: path.replace('file://', ''),
ios: path,
}),
},
],
}).promise
Before you upload files make sure that each file exist. if you are uploading picture. you can preview the image first and remove white/corrupted images before you upload.
Most helpful comment
Try to remove the protocol
file://from the path on Android. It worked for me: