filemanager: find a new unique name when file copy clashes

This commit is contained in:
Johannes Zellner
2021-03-16 21:24:26 +01:00
parent 10d1bb861a
commit 515d93f5ef
2 changed files with 4 additions and 1 deletions

View File

@@ -512,7 +512,7 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
async.eachLimit(collectedFiles, 5, function (entry, callback) {
var newFilePath = sanitize($scope.cwd + '/' + ((destinationEntry && destinationEntry.isDirectory) ? destinationEntry.fileName : '') + '/' + entry.fullFilePath);
// TODO this will NOT overwrite files in destination!
// This will NOT overwrite but finds a unique new name to copy to
Client.filesCopy($scope.id, $scope.type, entry.fullFilePath, newFilePath, callback);
}, function (error) {
if (error) return Client.error(error);