Cannot create folder

7 posts, 1 answers
  1. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2011 Link to this post

    Geting the error: "The selected folder could not be created because the application did not have enough permissions. Please contact the administrator"

    This happens when I call createNewDirectory. I have looked around the forums for a soultion but nothing seems to work. How can I troubleshoot this. It doesn't seem to be permissions from what I have checked.

    I tried this and it worked fine, meaning the code Fiko asks to run works fone:

    http://www.telerik.com/community/forums/aspnet-ajax/file-explorer/cannot-create-folder-can-do-everything-else.aspx

    Here is my simple test code, and I have full access on the server and the account used also has full permissions. I have used sysinternals procmon anbd I do not even see a denial of access, how can I trouble shoot this:

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
     
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
     
    </head>
     
     
    <body>
     
    <telerik:RadScriptBlock ID="RadScriptBlock" runat="server">
     
     
    </telerik:RadScriptBlock>
        <form id="form1" runat="server">
       
        <div>
                <script type="text/javascript" language="javascript">
                 
                    function GetName() {
                        var MyFM = $find('<%= RadFileExplorer1.ClientID %>');
                        MyFM.createNewDirectory("/Test", "556477");
                        alert("test");
                    }
    </script>
            <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            </telerik:RadScriptManager>
     
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            </telerik:RadAjaxManager>
            <telerik:RadFileExplorer ID="RadFileExplorer1" Runat="server"
                InitialPath="~/Test/" EnableCreateNewFolder="true" OnClientItemSelected="GetName"  >
    <Configuration SearchPatterns="*.*" ViewPaths="~/Test/" UploadPaths="~/Test/" DeletePaths="~/Test/" ></Configuration>
            </telerik:RadFileExplorer>
     
    <asp:Button runat="server" ID="btnClick" onclientclick="GetName" Width="94px"></asp:Button>
        </div>
     
        </form>
    </body>
    </html>


  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 11 Oct 2011 Link to this post

    Hi James,

    Could you please verify that the path provided to the createNewFolder() method matches the the path displayed in the RadFileExplorer's AddressBar - please see the attached screenshot for reference?

    Greetings,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2011 Link to this post

    Yes, it matches exactly, I have tried it like "~\test\" and "\test" and "test". Nothing seems to work same error.
  5. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2011 Link to this post

    Any method noted to test this, I would assure you that it is your code generating this error. It doesn't even seem to get that response from the server as when I run procmon I do not even see access denied and I have setup Windows Security to audit the folder for failures and stil nada, please help, this is really holding me up. I have sent the source of a simple test project to support but no reply yet.
  6. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 11 Oct 2011 Link to this post

    Hi James,

    Please accept my sincere apologies for not being clear enough in my first reply.

    The first parameter that createNewFolder() method expects should use the following syntax :
    <ApplicationRootFolder> / <PathToTheFolderListedInTheFileExplorer>
    In the screenshot in my previous reply "ToBeDeleted2" is the application's root folder - the ~(tilde) corresponds to this folder on the server.

    You can simulate ~/ on the client using the following approach:
    function GetName()
    {
        var MyFM = $find('<%= RadFileExplorer1.ClientID %>');
        var appRoot = '<%= VirtualPathUtility.ToAbsolute("~") %>';
        MyFM.createNewDirectory(appRoot + "/Test", "556477");
        alert("test");
    }

    In addition, I noticed that GetName() function is attached as handler to the RadFileExplorer's ClientItemSelected. Please note that after creating a new directory the explorer automatically selects the newly created folder, and this will cause infinity loop.

    Regards,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  7. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2011 Link to this post

    Yeah, I noticed the looping, I just put it there to see if the folder would even be created. I will try your solution and let you know how it works out. Thanks for the reply.
  8. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 11 Oct 2011 Link to this post

    Worked like a charms, thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017