-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
access content://com.android.providers.media.documents/document/image%3A99 #351
Comments
Hi @EyalSi! The scheme "content://" is currently not supported. PRs are very appreciated. |
@itinance Does this still need to be resolved? I saw a PR request that could resolve it but I believe it was rejected? |
I have the same error, any updates ? |
I have a fix locally in my project; however, I am hesitant to create a PR request since there is one that does the same already pending. |
@LukBowen which one do you mean? |
PR #49 |
Yes, i remember. I turned back to the contributor but he never answered. I will modify this PR manually to keep backward compatibility alive. |
Sorry, I didn't realize that was it was missing backwards compatibility. Other wise I would have just create my own PR. |
Submitting your own PR would be a good option! I would merge quickly (while CET-timezone ;) ) |
I can still do it; however, it will have to be later today. Currently working on a separate project at work. |
Great and many thanks. No rush :) |
Hey @itinance, I just added a PR based on @jrichardlai's work. I hope we'll finally be able to work with content URI's on Android with no trouble! 🙂 |
I've just tested the latest version (2.9.7) and it's working perfectly! THANKS! |
It is not working for me. DocumentPicker.show({ filetype: fileTypeArray }, (error,result) => {
let uri = Platform.OS === "ios" ? result.uri.replace("file://", "") : `file://${result.uri}`;
console.log(result)
const fs = require("react-native-fs")
fs.stat(decodeURIComponent(uri)).then(resp => {
console.log(resp)
})
let file = {
uri: result.uri,
type: result.type,
name: result.fileName,
size: result.fileSize,
} and this is what I get 05-19 12:57:18.639 6494 7163 W ReactNativeJS: Possible Unhandled Promise Rejection (id: 0):
05-19 12:57:18.639 6494 7163 W ReactNativeJS: Error: File does not exist Version: "react-native-fs": "^2.9.12", |
content://com.android.providers.media.documents/document/image%3A400331 |
@kushalsharma12 have u got any solution for it? |
@AliAzaz nope |
any solution .... guys |
need a solution! |
i'm getting same error File does not exist |
I'm getting a content uri in android while using react-native-document-picker or react-native-contacts (for the avatars).
URIs like:
'content://com.android.providers.media.documents/document/image%3A99'
Trying to access this file fails with "File does not exist"
const urlDecoded = decodeURIComponent(url);
RNFS.stat(urlDecoded)
.then((file) => {
console.log("RNFS URL SUCCESS", file);
})
.catch((err) => {
console.log("RNFS URL ERROR", err);
});
Any idea how to access the file?
10x
The text was updated successfully, but these errors were encountered: