In my project, I have to clone some specific file and rename it with adding a prefix "Copy-".
original: itemA, itemB, itemC Now: itemA, itemB, itemC, Copy-itemA
So, I tried the following code to move the file between the same library and folder.
SPFile cloneFile= doc.File; moveFile.MoveTo(Path.Combine(originalItem.Url, "Copy" + fileName ));
It fails! It just replaces my original file with the name "Copy-XXXX" :(
original: itemA, itemB, itemC Now: Copy-itemA, itemB, itemC,
any idea ?