hiddentao / cordova-plugin-filepath

Resolve native file paths from content URLs for Cordova platforms
Apache License 2.0
66 stars 127 forks source link

[Blocker] resolveNativePath is failing in android 11 #76

Open sahalshn opened 2 years ago

sahalshn commented 2 years ago
cordova-plugin-filechooser 1.2.0 "File Chooser"
cordova-plugin-filepath 1.6.0 "cordova-plugin-filepath"

Unable to read file native path in android 11. This is only happening for files that are uploaded from the download folder.

this.fileChooser.open()
        .then(uri => {
          let pdfname = uri.substring(uri.lastIndexOf("/") + 1);
          let pdfExt = pdfname.substr(pdfname.lastIndexOf('.') + 1);
          if (pdfExt == 'pdf') {
            // let name = pdfname.split('.').slice(0, -1).join('.');
            this.processPDF(uri, '');
          }
          else {
            this.filePath.resolveNativePath(uri)
              .then(file => {
                let filename = file.substring(file.lastIndexOf("/") + 1);
                let fileExt = filename.substr(filename.lastIndexOf('.') + 1);
                if (fileExt == 'pdf') {

                }

              })
              .catch(err => {
                // Here err is {code: 0, message: 'Unable to resolve filesystem path. hahahha'}
              });
          }
        })
sahalshn commented 2 years ago

@hiddentao Can you please have look into it

hiddentao commented 2 years ago

@sahalshn I am no longer actively maintaining this repo