You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Mickael Magniez (JIRA)" <ji...@apache.org> on 2015/04/21 15:10:59 UTC

[jira] [Created] (CB-8881) [FileTransfert] Object values in params as send as string

Mickael Magniez created CB-8881:
-----------------------------------

             Summary: [FileTransfert] Object values in params as send as string
                 Key: CB-8881
                 URL: https://issues.apache.org/jira/browse/CB-8881
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin File Transfer
    Affects Versions: 3.5.0
            Reporter: Mickael Magniez


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

Example:
{code:javascript}
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);
{code}

My server code receives params 
{code:javascript}
object1 = "{\"value1\":\"1\",{\"value2\":\"2\"}"
object2 = "{\"value1\":\"1\",{\"value2\":\"2\"}"
{code}

It should receive
{code:javascript}
object1 = {value1: "1", value2: "2"}
object2 = {value1: "1", value2: "2"}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org