From dcc98db15fdbca24cd48e3bb6e802f1066314703 Mon Sep 17 00:00:00 2001 From: biodiv Date: Mon, 16 Mar 2015 16:33:59 +0100 Subject: [PATCH] CB-8816 Add cdvfile:// support on windows github close #70 --- src/windows/FileTransferProxy.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/windows/FileTransferProxy.js b/src/windows/FileTransferProxy.js index c056839..0c4e8b0 100644 --- a/src/windows/FileTransferProxy.js +++ b/src/windows/FileTransferProxy.js @@ -90,6 +90,9 @@ exec(win, fail, 'FileTransfer', 'upload', // Handle 'ms-appdata' scheme filePath = filePath.replace('ms-appdata:///local', appData.localFolder.path) .replace('ms-appdata:///temp', appData.temporaryFolder.path); + } else if (filePath.indexOf('cdvfile://') === 0) { + filePath = filePath.replace('cdvfile://localhost/persistent', appData.localFolder.path) + .replace('cdvfile://localhost/temporary', appData.temporaryFolder.path); } // normalize path separators filePath = cordovaPathToNative(filePath); @@ -259,6 +262,9 @@ exec(win, fail, 'FileTransfer', 'upload', // Handle 'ms-appdata' scheme target = target.replace('ms-appdata:///local', appData.localFolder.path) .replace('ms-appdata:///temp', appData.temporaryFolder.path); + } else if (target.indexOf('cdvfile://') === 0) { + target = target.replace('cdvfile://localhost/persistent', appData.localFolder.path) + .replace('cdvfile://localhost/temporary', appData.temporaryFolder.path); } target = cordovaPathToNative(target);