Please provide the following:
- SDK Version: 4.10.1
- Platforms(Android/iOS/web/all): Android
- Add the appropriate “Tag” based on what Expo library you have a question on.
Hello, I’m having some troubles with uploading documents.
It seems like the documents doesn’t exist in cache.
const handleUploadDocument = async () => {
const doc = await DocumentPicker.getDocumentAsync()
if (doc.type !== 'cancel') {
console.log(doc)
FileSystem.getInfoAsync(doc.uri).then((t) => console.log('Does it exist?', t.exists))
}
}
}
This prints out:
Object {
"name": "20210823_220428.jpg",
"size": 3228884,
"type": "success",
"uri": "/data/user/0/host.exp.exponent/cache/ExperienceData/%40stephanbv%2F24mobiApp/DocumentPicker/e859f01b-082f-4927-87e5-16674d2bf29e.jpg",
}
Does it exist? false
I also have a ImagePicker with almost identical code:
const handleTakePhoto = async () => {
const result = await ImagePicker.launchCameraAsync({
mediaTypes: MediaTypeOptions.Images,
allowsEditing: true,
quality: 0.4,
})
if (!result.cancelled) {
console.log(result)
FileSystem.getInfoAsync(result.uri).then((t) => console.log('Does it exist?', t.exists))
}
}
This prints out:
Object {
"cancelled": false,
"height": 3226,
"type": "image",
"uri": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540stephanbv%252F24mobiApp/ImagePicker/6a2d9b48-dc68-4c87-9c2b-8fa5e0c184a5.jpg",
"width": 2420,
}
Does it exist? true
So the document from ImagePicker exist in cache, but not the DocumentPicker.
Anyone got any tips to how I can move forward on this issue?
ImagePicker v 10.2.2
DocumentPicker v 9.2.4