React-native-document-picker: Error : File not exist

Created on 20 Apr 2017  路  6Comments  路  Source: rnmods/react-native-document-picker

After selecting the file from iCloud using Iphone Device or Simulator, when i am try to upload this file getting file not exist error.

Any help please ?

FAQ

Most helpful comment

I may have found the problem. The document I was picking had a space on its name and the received file path was replacing it by %20. Consequently, the lib I was using to upload the file was looking for the wrong file.

More generally this can be an issue with all chars that get URL encoded. Using decodeURIComponent did the trick for me.

All 6 comments

Have you asserted that the file was indeed copied first from iCloud to the temporary folder?

The URI I receive is something like

file:///private/var/mobile/Containers/Data/Application/\

Then I try to pass it to RNFetchBlob for upload.

I'm not iOS dev, so I digging deeper in order to understand if I'm missing a permission or if RNFetchBlob expect another URI format. @rajeshkos did you solved the issue?

I may have found the problem. The document I was picking had a space on its name and the received file path was replacing it by %20. Consequently, the lib I was using to upload the file was looking for the wrong file.

More generally this can be an issue with all chars that get URL encoded. Using decodeURIComponent did the trick for me.

Also see: https://github.com/joltup/rn-fetch-blob/issues/116

That resolved this error for me.

closing in favor do #368

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vsrinivas150283 picture vsrinivas150283  路  3Comments

MuneebJS picture MuneebJS  路  5Comments

ashish-algorythma picture ashish-algorythma  路  7Comments

andrey-shostik picture andrey-shostik  路  9Comments

FrankFundel picture FrankFundel  路  5Comments