[
https://issues.apache.org/jira/browse/CB-11067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15288461#comment-15288461
]
ASF GitHub Bot commented on CB-11067:
-------------------------------------
Github user cordova-qa commented on the pull request:
https://github.com/apache/cordova-plugin-file-transfer/pull/140#issuecomment-219928043
Cordova CI Build has one or more failures.
**Commit** -
[Link](https://github.com/apache/cordova-plugin-file-transfer/pull/140/commits/7673590ad65a673c7578f7eead78fd4bd083f05c)
**Dashboard** -
[Link](http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5/)
| Builder Name | Console Output | Test Report | Device Logs |
| :---: | :---: | :---: | :---: |
| [Windows 8.1 Store](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-store/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-store/console)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-store/testReport/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-store/artifact/)
|
| [Windows 10 Store](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-10-store/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-10-store/console)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-10-store/testReport/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-10-store/artifact/)
|
| [Windows 8.1 Phone](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-phone/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-phone/console)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-phone/testReport/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=windows-slave,platformName=windows-8.1-phone/artifact/)
|
| [iOS](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=ios/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=ios/console)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=ios/testReport/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=ios/artifact/)
|
| [Android Mac](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=android/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=android/console)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=android/testReport/)
| [Link](
http://cordova-ci.cloudapp.net:8080/job/cordova-plugin-file-transfer-pr/5//label=mac-slave,platformName=android/artifact/)
|
> Content-Length missing in multipart form upload header on Android
> -----------------------------------------------------------------
>
> Key: CB-11067
> URL: https://issues.apache.org/jira/browse/CB-11067
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File Transfer
> Environment: Plugin version 1.5.0
> chunked = false
> Reporter: Odd Christer Brovig
> Labels: Android, triaged
>
> On iOS Content-Length is sent as part of header for multipart form. On
> Android only Content-Disposition and Content-Type is sent.
> Is there a special reason for this? I see that the file size is read after
> the beforeData is converted to bytes.
> From FileTransfer.java:
> {code:java}
>
> beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
> beforeData.append("Content-Disposition: form-data;
> name=\"").append(fileKey).append("\";");
> beforeData.append("
> filename=\"").append(fileName).append('"').append(LINE_END);
> beforeData.append("Content-Type:
> ").append(mimeType).append(LINE_END).append(LINE_END);
> byte[] beforeDataBytes =
> beforeData.toString().getBytes("UTF-8");
> byte[] tailParamsBytes = (LINE_END + LINE_START +
> BOUNDARY + LINE_START + LINE_END).getBytes("UTF-8");
> {code}
> From CDVFileTransfer.m:
> {code}
> [postBodyBeforeFile appendData:formBoundaryData];
> [postBodyBeforeFile appendData:[[NSString
> stringWithFormat:@"Content-Disposition: form-data; name=\"%@\";
> filename=\"%@\"\r\n", fileKey, fileName]
> dataUsingEncoding:NSUTF8StringEncoding]];
> if (mimeType != nil) {
> [postBodyBeforeFile appendData:[[NSString
> stringWithFormat:@"Content-Type: %@\r\n", mimeType]
> dataUsingEncoding:NSUTF8StringEncoding]];
> }
> [postBodyBeforeFile appendData:[[NSString
> stringWithFormat:@"Content-Length: %ld\r\n\r\n", (long)[fileData length]]
> dataUsingEncoding:NSUTF8StringEncoding]];
> {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]