When you take pdf anyother file from download you get URI with content://. So in order to resolve i use this package to get file URI path https://www.npmjs.com/package/cordova-plugin-filepath
It returns error code: 1 // not found
const options: CameraOptions = {
quality: 50,
destinationType: this._camera.DestinationType.FILE_URI,
mediaType: this._camera.MediaType.ALLMEDIA,
sourceType: this._camera.PictureSourceType.SAVEDPHOTOALBUM,
saveToPhotoAlbum: false,
};
if (file.indexOf("content://") > -1) {
console.log("content //", file);
window.FilePath.resolveNativePath(file, (success) => {
console.log(success, "content");
window.resolveLocalFileSystemURL(success, (fileEntry) => {
console.log(fileEntry, "fileEntry");
fileEntry.file((finalFile) => {
console.log(finalFile, "resolve");
resolve(finalFile);
});
});
});
}
chrome://inspect
1 post - 1 participant