[ 
https://issues.apache.org/jira/browse/CB-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14383389#comment-14383389
 ] 

ASF GitHub Bot commented on CB-6313:
------------------------------------

GitHub user dpolivy opened a pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/73

    CB-6313 [wp8]: Extra boundary in upload

    When performing an upload on Windows Phone, an extra boundary is
    included after any parameters, and before the file contents. This causes
    some servers (such as express/multiparty on node.js) to fail to handle
    the request properly.
    
    This commit removes the extraneous boundary.
    
    Fixes https://issues.apache.org/jira/browse/CB-6313

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dpolivy/cordova-plugin-file-transfer CB6313

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-file-transfer/pull/73.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #73
    
----
commit 237dd43b4d28c1a0e074bafedd404e6a7566cc7e
Author: Dan Polivy <[email protected]>
Date:   2015-03-27T06:13:12Z

    CB-6313 [wp8]: Extra boundary in upload
    
    When performing an upload on Windows Phone, an extra boundary is
    included after any parameters, and before the file contents. This causes
    some servers (such as express/multiparty on node.js) to fail to handle
    the request properly.
    
    This commit removes the extraneous boundary.
    
    Fixes https://issues.apache.org/jira/browse/CB-6313

----


> Extra boundary in FileTransfer upload on Windows Phone
> ------------------------------------------------------
>
>                 Key: CB-6313
>                 URL: https://issues.apache.org/jira/browse/CB-6313
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File Transfer, WP8
>    Affects Versions: 3.4.0
>         Environment: Windows Phone 8; Cordova 3.4.0
>            Reporter: Dan Polivy
>            Assignee: Jesse MacFadyen
>              Labels: filetransfer, windows-phone, wp8
>
> I am using the File Transfer plugin on Windows Phone 8, and am adding 
> additional parameters to the upload via FileTransferOptions.params. When 
> doing this, I've found that an extra boundary is emitted into the request, 
> which unfortunately causes my node.js server (running express) to fail in 
> parsing the form submission.
> The form submission ends up looking like this (notice the extra boundary 
> included after the parameters, and before the file itself):
> ------------------------------8d1119c8955f52c
> Content-Disposition: form-data; name="param1"
> 1
> ------------------------------8d1119c8955f52c
> Content-Disposition: form-data; name="param2"
> 2
> ------------------------------8d1119c8955f52c
> ------------------------------8d1119c8955f52c
> Content-Disposition: form-data; name="file"; 
> filename="///CapturedImagesCache/C__Data_Users_Public_Pictures_Camera 
> Roll_WP_20140319_001_jpg.jpg"
> {data}
> ------------------------------8d1119c8955f52c--
> I've reviewed the code, and believe it is simply a one line fix to remove the 
> line causing the issue, but confirmation from one of the owners would be 
> helpful.
> For me, it is line 746 of FileTransfer.cs:
> requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
> I've confirmed that commenting out this line in my app will allow the upload 
> to complete successfully.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to