You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2013/02/13 18:06:13 UTC

[jira] [Comment Edited] (CB-2423) FileTransfer does not set Content-Length header even if known -- unable to upload to Amazon

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

Shazron Abdullah edited comment on CB-2423 at 2/13/13 5:04 PM:
---------------------------------------------------------------

I can confirm this in a side project I've been working on while uploading a file using FileTransfer(POST) to Amazon S3 (the exact same code works on iOS). Used Cordova 2.3.0
                
      was (Author: shazron):
    I can confirm this in a side project I've been working on while uploading a file using FileTransfer(POST) to Amazon S3.
                  
> FileTransfer does not set Content-Length header even if known -- unable to upload to Amazon
> -------------------------------------------------------------------------------------------
>
>                 Key: CB-2423
>                 URL: https://issues.apache.org/jira/browse/CB-2423
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.4.0
>         Environment: Android client
>            Reporter: Thomas O'Dell
>            Assignee: Joe Bowser
>              Labels: features
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> FileTransfer does not set the Content-Length header even when known, which causes Amazon S3 to return HTML Code 411 (Length Required).
> Adding the following lines after line 328 solves the problem:
>     if (fixedLength >= 0) {
>        conn.setRequestProperty("Content-Length", ""+fixedLength);
>     }
> (Haven't tested on iOS, but see that iOS does have code to set Content-Length.)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira