mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Fix cordova file transfer download
This commit is contained in:
@@ -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',
|
||||
|
||||
Vendored
+4
-4
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user