incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aurelien MERCIER (JIRA)" <>
Subject [jira] [Commented] (CB-861) Header support for PhoneGap's FileTransfer (download)
Date Mon, 04 Jun 2012 21:11:22 GMT


Aurelien MERCIER commented on CB-861:

To be able to download a file from the community, I had to patch the download method since
we are using oauth2.
I was wondering if you could add this modification for future Cordova releases?
Here are my fix:

cordova-1.7.0.js: (add params as a parameter of the download method) = function(source, target, successCallback, errorCallback,
params) {
    exec(win, errorCallback, 'FileTransfer', 'download', [source, target, params]);
Change the download method signature (add params) l 444 :
private PluginResult download(String source, String target, JSONObject params) {

add the following code after line 459: 

                // Handle headers
                try {
                    JSONObject headers = params.getJSONObject("headers");
                    for (Iterator iter = headers.keys(); iter.hasNext();)
                        String headerKey =;
                        connection.setRequestProperty(headerKey, headers.getString(headerKey));
                } catch (JSONException e1) {
                    // No headers to be manipulated!

By the way, this issue has not been solved by CB-78 since it was only for the upload method.
So, if you could add that to the download method it would be great.

> Header support for PhoneGap's FileTransfer (download)
> -----------------------------------------------------
>                 Key: CB-861
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>    Affects Versions: 1.7.0
>            Reporter: Aurelien MERCIER
>            Assignee: Joe Bowser

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message