[
https://issues.apache.org/jira/browse/CB-10771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15212217#comment-15212217
]
ASF GitHub Bot commented on CB-10771:
-------------------------------------
Github user jasongin commented on a diff in the pull request:
https://github.com/apache/cordova-plugin-file-transfer/pull/133#discussion_r57474870
--- Diff: src/windows/FileTransferProxy.js ---
@@ -359,7 +359,13 @@ exec(win, fail, 'FileTransfer', 'upload',
if (params.hasOwnProperty(key)) {
var contentPart = new
Windows.Networking.BackgroundTransfer.BackgroundTransferContentPart();
contentPart.setHeader("Content-Disposition",
"form-data; name=\"" + key + "\"");
- contentPart.setText(params[key]);
+ // CreateUploadSync fails when supplied with
empty value for setText function. Pass " " instead when not specified.
+ if (params[key]) {
+ contentPart.setText(params[key]);
+ }
+ else {
+ contentPart.setText(" ");
--- End diff --
Should a null/empty parameter just be omitted from the transfer instead?
> plugin-file-transfer upload on windows fails when params has a key with a
> null value
> ------------------------------------------------------------------------------------
>
> Key: CB-10771
> URL: https://issues.apache.org/jira/browse/CB-10771
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File Transfer
> Affects Versions: 1.5.0
> Environment: Windows, cordova 6.0.0
> Reporter: Paul Hickman
> Assignee: Raghav Katyal
> Labels: windows
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> In the windows version of plugin-file-transfer, if you set the options such
> that a key inside the params object has a null value: e.g.
> var options = { params: { keyName: null } }
> Then it will fail to upload with an INVALID_URL error because an exception
> occurs trying to convert the key keyName into a transfer chunk.
> This does not cause an error in the ios or android versions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]