You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Bennet Huber (Commented) (JIRA)" <ji...@apache.org> on 2011/12/15 23:25:30 UTC
[jira] [Commented] (CB-74) Add ContentLength Header in Upload
request
[ https://issues.apache.org/jira/browse/CB-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170533#comment-13170533 ]
Bennet Huber commented on CB-74:
--------------------------------
As a workaround, I've found there's an undocumented argument you can set on the options that fixes this:
var ft = new FileTransfer();
//Set more stuff here...
var opts = {};
opts.chunkedMode = false;
ft.upload(fileURI, serverURL, onSuccess, onFail, opts);
This somehow magically makes Android set the content length for the POST request, I'm not entirely sure why though. Found the fix on http://www.countermarch.com/blog/index.cfm/2011/10/27/PhoneGap-FileTransfer-and-ColdFusion
> Add ContentLength Header in Upload request
> ------------------------------------------
>
> Key: CB-74
> URL: https://issues.apache.org/jira/browse/CB-74
> Project: Apache Callback
> Issue Type: Bug
> Components: Android, BlackBerry, iOS
> Affects Versions: 1.1.0
> Reporter: Simon MacDonald
>
> Some servers require a ContentLength on POST requests.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira