filemanager: implement copy for files

This commit is contained in:
Johannes Zellner
2021-02-01 16:45:55 +01:00
parent 436c54b829
commit 2935fa6a36
2 changed files with 26 additions and 0 deletions

View File

@@ -377,7 +377,22 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
$scope.refresh();
});
} else {
// TODO collect files recoursively if we have folders
// copy files
async.eachLimit($scope.clipboard, 5, function (entry, callback) {
var newFilePath = sanitize($scope.cwd + '/' + ((destinationEntry && destinationEntry.isDirectory) ? destinationEntry.fileName : '') + '/' + entry.fileName);
// TODO this will NOT overwrite files in destination!
Client.filesCopy($scope.id, $scope.type, entry.fullFilePath, newFilePath, callback);
}, function (error) {
if (error) return Client.error(error);
// clear clipboard
$scope.clipboard = [];
$scope.refresh();
});
}
};