You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue with the fs.exists function in ReactNativeBlobUtil. The code I'm using is: const fileExist = await ReactNativeBlobUtil.fs.exists(path ?? '');
When the file is located in the cache folder, the function works correctly and returns true if the file exists. However, when the file is not in the cache folder and the path contains 'content', such as content://com.android.providers.downloads.documents/document/msf%3A1000000018, the function always returns false.
Reproduction Steps:
Use a file path containing 'content' (e.g., content://com.android.providers.downloads.documents/document/msf%3A1000000018).
Call ReactNativeBlobUtil.fs.exists(path).
Observe that the function returns false, even if the file exists.
Expected Behavior:
The fs.exists function should correctly identify the existence of a file, even when the path includes 'content://'.
Additional Context:
I found a potential solution in another package that handles similar paths. The relevant implementation can be seen in the react-native-file-viewer repository: solution(see line 50).
Proposed Solution:
Could you integrate a similar approach to handle 'content://' paths in your library? This would greatly enhance the functionality and reliability of fs.exists and similar methods.
Environment:
React Native Version: 0.73.6
ReactNativeBlobUtil Version: 0.19.9
Platform: Android
Thank you for your attention to this issue.
The text was updated successfully, but these errors were encountered:
Aleksandriukas
changed the title
ReactNativeBlobUtil.fs does not working if path contains 'content://'
ReactNativeBlobUtil.fs does not work if path contains 'content://'
May 28, 2024
Hi,
thank you for the report.
We got quite a bunch of these cases fixed already: https://github.com/RonRadtke/react-native-blob-util/pull/341/files
But there are still some missing. Hope I can addresse them in the next release. Otherwise, If you're willing to help out with a PR. Would appreciate it very much!
Same question. ReactNativeBlobUtil.fs.stat('content://xxx') will throw error [Error: failed to stat path null because it does not exist or it is not a folder]
I'm encountering an issue with the fs.exists function in ReactNativeBlobUtil. The code I'm using is:
const fileExist = await ReactNativeBlobUtil.fs.exists(path ?? '');
When the file is located in the cache folder, the function works correctly and returns true if the file exists. However, when the file is not in the cache folder and the path contains 'content', such as content://com.android.providers.downloads.documents/document/msf%3A1000000018, the function always returns false.
Reproduction Steps:
Use a file path containing 'content' (e.g., content://com.android.providers.downloads.documents/document/msf%3A1000000018).
Call ReactNativeBlobUtil.fs.exists(path).
Observe that the function returns false, even if the file exists.
Expected Behavior:
The fs.exists function should correctly identify the existence of a file, even when the path includes 'content://'.
Additional Context:
I found a potential solution in another package that handles similar paths. The relevant implementation can be seen in the react-native-file-viewer repository:
solution(see line 50).
Proposed Solution:
Could you integrate a similar approach to handle 'content://' paths in your library? This would greatly enhance the functionality and reliability of fs.exists and similar methods.
Environment:
React Native Version: 0.73.6
ReactNativeBlobUtil Version: 0.19.9
Platform: Android
Thank you for your attention to this issue.
The text was updated successfully, but these errors were encountered: