Fix cordova file transfer download

This commit is contained in:
Demian Gemperli
2015-08-19 18:33:32 +02:00
parent efa0c1196d
commit 132ed07af7
2 changed files with 10 additions and 6 deletions
+6 -2
View File
@@ -176,8 +176,12 @@ file.download('http://some.server.com/download.php',
console.error('Failed with exception ' + err.exception);
}
},
{ headers: null },
true);
true,
{
headers: {
"Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
}
});
file.upload('cdvfile://localhost/persistent/path/to/downloads/',
'http://some.server.com/download.php',
+4 -4
View File
@@ -53,8 +53,8 @@ interface FileTransfer {
target: string,
successCallback: (fileEntry: FileEntry) => void,
errorCallback: (error: FileTransferError) => void,
options?: FileDownloadOptions,
trustAllHosts?: boolean): void;
trustAllHosts?: boolean,
options?: FileDownloadOptions): void;
/**
* Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object
* which has an error code of FileTransferError.ABORT_ERR.
@@ -98,8 +98,8 @@ interface FileUploadOptions {
/** Optional parameters for download method. */
interface FileDownloadOptions {
/** A map of header name/header values. Use an array to specify more than one value. */
headers?: Object[];
/** A map of header name/header values. */
headers?: {};
}
/** A FileTransferError object is passed to an error callback when an error occurs. */