document-picker icon indicating copy to clipboard operation
document-picker copied to clipboard

Error : File not exist

Open rajeshkos opened this issue 9 years ago • 6 comments

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 ?

rajeshkos avatar Apr 20 '17 07:04 rajeshkos

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

Elyx0 avatar Apr 21 '17 12:04 Elyx0

The URI I receive is something like

file:///private/var/mobile/Containers/Data/Application/<some id>/tmp/<bundle id>-Inbox/<filename>.

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?

leonardocarvalho avatar May 02 '17 18:05 leonardocarvalho

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.

leonardocarvalho avatar May 02 '17 19:05 leonardocarvalho

This is similar to error https://github.com/Elyx0/react-native-document-picker/issues/25.

oliviachang29 avatar Jun 22 '17 19:06 oliviachang29

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

That resolved this error for me.

ahartzog avatar Feb 22 '19 13:02 ahartzog

closing in favor do #368

vonovak avatar Dec 25 '20 17:12 vonovak