Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12827

readAsText and readAsDataURL error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.4.0
    • None
    • cordova-plugin-file, Ionic
    • None
    • Android KitKat 4.4.2

    Description

      I'm using ngCordova cordova-plugin-file to try to read an image that I then want to convert to bytes. I actually want to read it as dataURL and I'm getting an error.

      /* The image is located at file:///data/data/com.xxx.housekeeping/cache/tmp_Screenshot_2017-04-27-09-30-42-1816635709.png on an Android device */

      `$cordovaFile.readAsText(cordova.file.cache, "tmp_Screenshot_2017-04-27-09-30-421403920141.png")
      .then(function (success)

      { // success console.log(success); }

      , function (error)

      { // error console.log(error); }

      );`

      I tried using both readAsText and readAsDataURL but I get

      `Wrong type for parameter "uri" of resolveLocalFileSystemURI: Expected String, but got Undefined.`

      as an error. This is on an Android device.

      Attachments

        Activity

          People

            Unassigned Unassigned
            MrShakes Olabosipo Shoroye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: