You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/02/12 02:49:05 UTC

[09/13] cordova-plugin-file-transfer git commit: CB-8407 Use File proxy to construct valid FileEntry for download success callback

CB-8407 Use File proxy to construct valid FileEntry for download success callback

Due to changes in file plugin (https://github.com/apache/cordova-plugin-file/commit/bcbeae24cd24583b790da95e0e076492eb16cd4f) result of download method should now have filesystemName specified for proper work. This updates download method to construct FileEntry properly, using File plugin proxy.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/5ee666ce
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/5ee666ce
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/5ee666ce

Branch: refs/heads/master
Commit: 5ee666ce0b65fcde396e45974795a86f1097e5bc
Parents: 28189e5
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Tue Feb 3 17:06:14 2015 +0300
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Feb 11 17:46:03 2015 -0800

----------------------------------------------------------------------
 src/windows/FileTransferProxy.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/5ee666ce/src/windows/FileTransferProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/FileTransferProxy.js b/src/windows/FileTransferProxy.js
index 2649282..df5dd0a 100644
--- a/src/windows/FileTransferProxy.js
+++ b/src/windows/FileTransferProxy.js
@@ -26,6 +26,7 @@
 var FTErr = require('./FileTransferError'),
     ProgressEvent = require('org.apache.cordova.file.ProgressEvent'),
     FileUploadResult = require('org.apache.cordova.file.FileUploadResult'),
+    FileProxy = require('org.apache.cordova.file.FileProxy'),
     FileEntry = require('org.apache.cordova.file.FileEntry');
 
 var appData = Windows.Storage.ApplicationData.current;
@@ -313,7 +314,9 @@ exec(win, fail, 'FileTransfer', 'upload',
                         .replace(appData.temporaryFolder.path, 'ms-appdata:///temp')
                         .replace('\\', '/');
 
-                    successCallback(new FileEntry(storageFile.name, storageFile.path, null, nativeURI));
+                    // Passing null as error callback here because downloaded file should exist in any case
+                    // otherwise the error callback will be hit during file creation in another place
+                    FileProxy.resolveLocalFileSystemURI(successCallback, null, [nativeURI]);
                 }, function(error) {
 
                     var getTransferError = new WinJS.Promise(function (resolve) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org