FileTransfer returns JSONObject with code, source and target for upload and download

This commit is contained in:
Alexander Keller
2011-11-30 09:15:01 +01:00
parent 8dbb8f58b1
commit f387720e54
2 changed files with 26 additions and 24 deletions
+4 -4
View File
@@ -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]);
};
/**