mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
FileTransfer returns JSONObject with code, source and target for upload and download
This commit is contained in:
@@ -85,13 +85,13 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
|
||||
|
||||
/**
|
||||
* Downloads a file form a given URL and saves it to the specified directory.
|
||||
* @param sourceUrl {String} URL of the server to receive the file
|
||||
* @param targetFile {String} Full path of the file on the device
|
||||
* @param source {String} URL of the server to receive the file
|
||||
* @param target {String} Full path of the file on the device
|
||||
* @param successCallback (Function} Callback to be invoked when upload has completed
|
||||
* @param errorCallback {Function} Callback to be invoked upon error
|
||||
*/
|
||||
FileTransfer.prototype.download = function(sourceUrl, targetFile, successCallback, errorCallback) {
|
||||
PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [targetFile, sourceUrl]);
|
||||
FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) {
|
||||
PhoneGap.exec(successCallback, errorCallback, 'FileTransfer', 'download', [source, target]);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user