Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

[Android] content:// to file://storage does not get resolve

$
0
0

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
image

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>