You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sergey Shakhnazarov (JIRA)" <ji...@apache.org> on 2015/12/07 11:12:11 UTC

[jira] [Resolved] (CB-8881) [FileTransfer] Object values in params as send as string

     [ https://issues.apache.org/jira/browse/CB-8881?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Shakhnazarov resolved CB-8881.
-------------------------------------
    Resolution: Fixed

Fixed in CB-9600

> [FileTransfer] 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