expo: iOS FileSystem Unable to save file to local URI

I have a FileSystem problem, when I run the example code:

const downloadResumable = FileSystem.createDownloadResumable(
  'http://techslides.com/demos/sample-videos/small.mp4',
  FileSystem.documentDirectory + 'small.mp4'
);

downloadResumable.downloadAsync()
  .then(({ uri }) => console.log(uri))
  .catch((error) => console.error(error));

I got a Unable to save file to local URI error.

My device is iPhone 7 iOS 10.0, and this is my packages:

"dependencies": {
  "expo": "^21.0.0",
  "react": "16.0.0-alpha.12",
  "react-native": "^0.48.4"
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@nikki93 Any idea when the next version is out?

I am also facing the same issue. It works fine on Android. This seems to be a regression in sdk 21, since it works on sdk 20

FileSystem API tries to decode filenames. You should call encodeURIComponent twice when you want to cache files by the original URI.

We landed a fix for this and the new version will be out soon (next 2-3 weeks, depends on Apple review process also). Feel free to continue discussing here!

@nicib83 It’s probably a little more involved than that. I’m going to do the same now, will report back how it goes. BTW take a look here https://forums.expo.io/t/how-to-downgrade-to-a-lower-expo-sdk-version/2099

Assigning to @nikki93 to take a look.