You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "John Sim (JIRA)" <ji...@apache.org> on 2013/08/05 11:10:48 UTC
[jira] [Created] (CB-4501) fileTransfer.download Authorization
Basic fails CONNECTION_ERR
John Sim created CB-4501:
----------------------------
Summary: fileTransfer.download Authorization Basic fails CONNECTION_ERR
Key: CB-4501
URL: https://issues.apache.org/jira/browse/CB-4501
Project: Apache Cordova
Issue Type: Bug
Components: BlackBerry
Affects Versions: 2.9.0
Environment: Blackberry 9750 OS6
Reporter: John Sim
Assignee: Lorin Beer
Passing basic authentication in the header doesn't work on Blackberry
Compiling and testing on IPad with same code works fine.
Example code -
{code:JavaScript|title=sample.js|borderStyle=solid}
var options = {
headers: {
Authorization: 'Basic ' + base64UserPass
}
};
alert(uri);
alert(path);
alert(vFileName);
alert(base64UserPass);
fileTransfer.download(
uri,
path +'/'+ vFileName,
function(entry) {
alert('success');
},
function(error) {
switch (error.code) {
case FileTransferError.FILE_NOT_FOUND_ERR:
alert('File not found: '+error.code);
break;
case FileTransferError.INVALID_URL_ERR:
alert('Invalid URL: '+error.code);
break;
case FileTransferError.CONNECTION_ERR:
alert('Connection Error: '+error.code);
break;
case FileTransferError.ABORT_ERR:
alert('Aborted error: '+error.code);
break;
}
},
true,
options
);
{code}
returns error.code === 3
CONNECTION_ERR
App can navigation and call the ajax request on other areas of the page and can authenticate against the same uri above in the webview.
--
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