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: [email protected]
For additional commands, e-mail: [email protected]