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

[FileTransfer] Object values in params as send as string

    XMLWordPrintableJSON

Details

    Description

      When tryin to send structured data with files, values as send as string (representing JSON object), rather than structured data.

      Example:

      var options = new FileUploadOptions();
      options.fileKey = "file";
      options.fileName = 'file.jpg';
      options.mimeType = "image/jpg";
      var params = {object1: {value1: "1", value2:"2"}, object2: {value1: "1", value2:"2"}};
      options.params = params;
      var ft = new FileTransfer();
      ft.upload(filePath, encodeURI(url), win, fail, options);
      

      My server code receives params

      object1 = "{\"value1\":\"1\",{\"value2\":\"2\"}"
      object2 = "{\"value1\":\"1\",{\"value2\":\"2\"}"
      

      It should receive

      object1 = {value1: "1", value2: "2"}
      object2 = {value1: "1", value2: "2"}
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mickaelmagniez Mickael Magniez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: