Skip to content

Correct converstion of file path to Uri - #6

Merged
birdofpreyru merged 2 commits into
birdofpreyru:dev-2.21from
IanOpenSpace:master
Aug 24, 2023
Merged

birdofpreyru merged 2 commits into
birdofpreyru:dev-2.21from
IanOpenSpace:master

Conversation

@IanOpenSpace

Copy link
Copy Markdown

I was using RNFS.readFile() on a file with & in its name and was getting a file not found error. Traced it down to this line. Uri.fromFile() has been around since API Level 1.

Full disclosure: I am currently using and tested this change on the original RNFS repo.

@birdofpreyru
birdofpreyru changed the base branch from master to dev-2.21 August 23, 2023 16:17
@birdofpreyru
birdofpreyru merged commit 86b0d0a into birdofpreyru:dev-2.21 Aug 24, 2023
adhorodyski added a commit to callstack-internal/Expensify-App that referenced this pull request Aug 24, 2026
getFileUri built the URI by concatenation, so Uri.parse read a "#" in
the path as a fragment and dropped the rest of the filename. On Android
that truncation broke ReceiptStorage.adopt for files chosen through the
document picker, which stayed in the app cache instead of reaching
durable storage.

The maintained fork carries the same one-line change:
birdofpreyru/react-native-fs#6

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants