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

Rename and delete file with CustomFileSystemProvider

1 Answer 59 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 12 Jan 2011, 04:30 PM
Hello, with this (http://www.telerik.com/support/kb/aspnet-ajax/fileexplorer/physical-paths-and-different-content-types.aspx) custom provider I can't delete and rename files. I fixed it:

public override string GetPath(string path)
{
    // First add the '~/' signs in order to use the VirtualPathUtility.GetDirectory() method ;
    /*string PathWithTilde = "~/" + path;
    string virtualPath = VirtualPathUtility.GetDirectory(PathWithTilde);
    virtualPath = virtualPath.Remove(0, 2);// remove the '~' signs
 
    return virtualPath;*/
    string virtualPath = "";
    if (Path.GetFileName(path).Length > 0)
        virtualPath = path.Replace(Path.GetFileName(path), "");
    return virtualPath;
}

It's correct?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 17 Jan 2011, 12:41 PM
Hi Denis,

Yes, your code looks correct and if it works as expected you can use it.

Regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
FileExplorer
Asked by
Denis
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or