RN: 0.57.0
rn-fetch-blob: 0.10.13
Tested on iOS. Not sure about android.
var path = 'file:///var/mobile/Containers/Data/Application/2E3CC4FC-1C0F-400B-8CC8-DE53E00B0B7C/Library/Caches/Camera/740DA991-7359-4CF8-B9F4-9BAB69B824AC.jpg'
var body = FetchBlob.wrap(path);
FetchBlob.fetch('POST', url, mime, body);
This will upload a zero byte file to server. To fix it, I have to remove the file:// prefix from path first.
They mentioned in Caveats
When passing a file path to the library, remove file:// prefix.
What is the reason for FetchBlob.wrap not catering for that?
+1
it might be related to what is told in the readme
When passing a file path to the library, remove file:// prefix.
What is the reason for FetchBlob.wrap not catering for that?
Most helpful comment
What is the reason for FetchBlob.wrap not catering for that?