URI - No such file or directory

#1

I am using react-native-fetch-blob with a detached Expo app. I get this error: RNFetchBlob failed to create single content request body :error when getting request stream: No such file or directory.

I only get this problem in my expo version of the project

My file path is:

RNFetchBlob-file://file:///data/user/0/com.flyreel.underwriterbot/cache/ExperienceData/%2540darkwata%252Fflyreel/Camera/967785f9-064f-44e2-9277-6d6650d76fe7.mp4

Maybe I need to bring the file into storage? Or perhaps its this %2540 encoding? I tried many things… Any ideas?

In my non-expo project this works:

RNFetchBlob-file://file:///storage/emulated/0/Movies/VID_20180405_163712.mp4
#2

Hey @darkwata,

I’m not sure about this error, but I just wanted to mention that Blob support is now part of React Native in version 0.54 and by extension Expo in SDK26. So I would recommend abandoning that library, especially as the author/maintainer of that library has been MIA for a long time now.

Cheers,

Adam

2 Likes
#3

Thanks @adamjnav! For now I need the library to do a PUT request to upload the Blob as the library makes it easier to do than the Blob support provided by React Native. Additionally, I’m not really sure how to send a Blob with the new React Native Blob support with Microsoft Blob Storage. I have looked at the firebase expo example but its rather different than Microsoft Blob Storage.

And Microsoft Blob Storage makes it hard to use FormData so I need to avoid it. Reason being FormData has a divider generated used to separate form fields, and microsft computes a hash based off of the request body, which contains this divider… which is not avaliable to you until the request has been set


Anyway, a workaround I found for this issue was to use react-native-fs https://github.com/itinance/react-native-fs

And move the file to the RNFS temporary directory and everything works, but it would be nice if this library fixed the issue with the %2540 encoding or Expo did not have these @ and / in their default file paths.

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.