react-native-documents / document-picker

Document Picker for React Native
https://react-native-documents.github.io/
MIT License
1.35k stars 440 forks source link

Document Picker Issue on iOS Devices #738

Closed MashoodAli-Official closed 2 months ago

MashoodAli-Official commented 2 months ago

Hi All! I have been using the Document Picker for a long time, but I recently faced an issue on iOS devices. Before explaining the issue, I would like to mention that I have tested the application both in a simulator and on an iOS device during development. Additionally, I have tested the app in production. However, the Document Picker is only functioning properly on Android.

Issue Details: Whenever I try to pick a document on an iOS device or simulator, it does not work unless the document file name follows specific formats, such as: Document-File.pdf Document_File.pdf DocumentFile.pdf If the document name does not contain a blank space, the document will not attach and just show a console warning in the Simulator. screenshot

screenshot

In contrast, it works fine on Android devices/emulators without the need to remove blank spaces from the file name.

Project info: "react": "^18.3.1", "react-native": "0.74.3", "react-native-date-picker": "^5.0.2",

ericchan3721 commented 2 months ago

It's not related to the Document Picker itself, you may take a look on this issue.

MashoodAli-Official commented 2 months ago

It's not related to the Document Picker itself, you may take a look on this issue.

Right now I am using RNFS so I don't want to use Expo file system.

vonovak commented 2 months ago

Hello and thanks for asking, the returned uri is percent-encoded. You need to use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI when you pass it over to RNFS.

Thank you 🙂