Skip to content
This repository was archived by the owner on Nov 9, 2021. It is now read-only.
This repository was archived by the owner on Nov 9, 2021. It is now read-only.

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

@indraraj26

Description

@indraraj26

Bug Report

Problem

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

What is expected to happen?

It should resolve and return file detail

What does actually happen?

It returns error code: 1 // not found

Information

chrome://inspect
image

Command or Code

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);
              });
            });
          });
        }

Environment, Platform, Device

All Android version i think so btw currently i am testing on Android 10

Version information

Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions