diff --git a/packages/react-native/src/ReactNativeFileSystem.ts b/packages/react-native/src/ReactNativeFileSystem.ts index a14ba4bd40..7c2b8b239c 100644 --- a/packages/react-native/src/ReactNativeFileSystem.ts +++ b/packages/react-native/src/ReactNativeFileSystem.ts @@ -66,8 +66,11 @@ export class ReactNativeFileSystem implements FileSystem { // Make sure parent directories exist await RNFS.mkdir(getDirFromFilePath(path)) + // Some characters in the URL might be invalid for + // the native os to handle. We need to encode the URL. + const encodedFromUrl = encodeURI(url) const { promise } = RNFS.downloadFile({ - fromUrl: url, + fromUrl: encodedFromUrl, toFile: path, })