This is a migrated thread and some comments may be shown as answers.

Rename of a file causes "File already exists" to show?

2 Answers 58 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 03 Mar 2014, 08:42 PM
I have a really basic method written for handling the renaming of files using the custom FileSystemContentProvider

01.public override string MoveFile(string path, string newPath)
02.{
03.    IC_Library.FileInfo info = new FileInfo(DataServer.ConnectionString);
04.    info.Name = VirtualPathUtility.GetFileName(newPath);
05.    info.Path = VirtualPathUtility.GetDirectory(newPath);
06.    info.ClientId = ClientId;
07.    info.PortalId = PortalId;
08. 
09.    info.MoveFile(path, info);
10. 
11.    return base.MoveFile(path, newPath);
12.}


The file rename works successfully, and everything refreshes properly and looks good, but when the rename completes, and before the explorer repopulates, I get the Javascript alert saying "A file by this name already exists!"

What's causing this?

2 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 03 Mar 2014, 08:44 PM
Already have more information to share :) the file I'm renaming is something basic like screenshot.3.jpg . When renaming to something like screenshotA, it doesn't show that message.

But when renaming to screenshot3.jpg, I get that message. Are special characters ignored?
0
Vessy
Telerik team
answered on 06 Mar 2014, 01:54 PM
Hi David,

I tried to reproduce the reported issue with our DB content provider, but the renaming is working properly with it - video. Could you verify that you are using this content provider or you have implemented your custom one?

In order to provide any further assistance on the case I will need to examine to reproduce the issue on my side. Could you, please, prepare a sample fully runnable project replicating the problem (including all needed references) and send it for a further investigation?

Kind regards,
Vessy
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Tags
FileExplorer
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or