-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Hi there
Using a standard implementation to download files and save them locally on the device.
When they are downloaded, I am not able to locate them on the device with for example "File Explorer" app, tried on emulator and physical iPad.
const urlExtensions = this.getUrlExtension(attachment.url);
const localFile = `${RNFS.LibraryDirectoryPath}/${attachment.title}.${urlExtensions}`;
const options = {
fromUrl: attachment.url,
toFile: localFile,
fileCache: true
};
if (await RNFS.exists(localFile)) {
FileViewer.open(localFile);
} else {
await RNFS.downloadFile(options).promise
.then(() => {
FileViewer.open(localFile);
})
.then((res) => {
// success
// console.log("success");
})
.catch(error => {
// error
console.log("Attachment open error: ", error);
});
}Also tried to use "DocumentDirectoryPath", same issue.
Thanks in advance
Regards
Metadata
Metadata
Assignees
Labels
No labels