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

FileTransfer escapes callback arguments on iOS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • cordova-ios
    • None
    • iPad and iPhone running iOS6

    Description

      I've hit an obscure error when using Cordova 2.1 FileTransfer to upload a file and parse the response as json text (on iOS6):

      "Error in success callback: FileTransfer15=SyntaxError: Unable to parse JSON string".

      The code i was using for success callback looks like this:

      var win = function(r) {
      var result = $.parseJSON(r);
      // stuff being done with parsed result object
      }

      Digging up on the error, i found that, somewhy, the argument string returned by FileTransfer native part to this callback is escaped, and as such can't be parsed to JSON. This is inconsistent with FileTransfer's behaviour on android as well as with the other plugins and normal handling of ajax calls, so i'm filing this as bug.

      Attachments

        Activity

          People

            agrieve Andrew Grieve
            kilozord anton kukushkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: