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

Cannot create folder

6 Answers 115 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
James Campbell
Top achievements
Rank 1
James Campbell asked on 11 Oct 2011, 10:18 AM

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>


6 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 11 Oct 2011, 11:27 AM
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
0
James Campbell
Top achievements
Rank 1
answered on 11 Oct 2011, 11:54 AM
Yes, it matches exactly, I have tried it like "~\test\" and "\test" and "test". Nothing seems to work same error.
0
James Campbell
Top achievements
Rank 1
answered on 11 Oct 2011, 07:52 PM
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.
0
Accepted
Dobromir
Telerik team
answered on 11 Oct 2011, 09:03 PM
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
0
James Campbell
Top achievements
Rank 1
answered on 11 Oct 2011, 09:32 PM
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.
0
James Campbell
Top achievements
Rank 1
answered on 12 Oct 2011, 02:47 AM
Worked like a charms, thanks.
Tags
FileExplorer
Asked by
James Campbell
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
James Campbell
Top achievements
Rank 1
Share this question
or