Issue with RadFileExplorer: "A file with a name same as the target already exists!"

0 Answers 4 Views
FileExplorer
Kavindu
Top achievements
Rank 1
Kavindu asked on 02 May 2025, 04:56 AM

Hi,

I'm using RadFileExplorer in a project that includes file version control. Occasionally, when attempting to save a new version of a file, I receive the alert:
"A file with a name same as the target already exists!"

This issue seems inconsistent — it doesn't appear limited to a specific file type, but I've noticed it more frequently with image files or files that have numbers in their names.

I came across a possible solution in this File Explorer as a Version Control issues. in UI for ASP.NET AJAX | Telerik Forums, where it was suggested to modify the GetFIle method to always return null. Here's the method :

public override Stream GetFile(string url)
{
    string virtualPath = RemoveProtocolNameAndServerName(url);
    string physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);
    if (physicalPath == null)
        return null;

    if (!File.Exists(physicalPath))
    {
        return null;
    }

    return File.OpenRead(physicalPath);
}

if it is okay to overriding this method to always return null? Is it a safe and recommended approach to prevent the "file already exists" error in version control scenarios?

No answers yet. Maybe you can help?

Tags
FileExplorer
Asked by
Kavindu
Top achievements
Rank 1
Share this question
or