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

cannot create folder - can do everything else

3 Answers 128 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
mac
Top achievements
Rank 1
mac asked on 26 Nov 2010, 01:41 AM
I am having a strange issue.
I can Delete folder, I can upload image, I can move image, I can move folder. I CANNOT create new folder.
Windows Internet Explorer popup msg after click 'new folder' with calling it mytestfolder

Request for the permission of type system.security.permissions.FileIOPermission,mscorlib, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Any ideas? I got the ISP to grant the iuser acct full prvlg and that did not get rid of the issue.
<telerik:RadScriptManager ID="RSM" runat="server"></telerik:RadScriptManager>
  <telerik:RadFileExplorer Width="400" ID="RadFileExplorer1" Runat="server">
            <configuration DeletePaths="~/Images/CMS"  
            UploadPaths="~/Images/CMS" 
             MaxUploadFileSize="200000"
            ViewPaths="~/Images/CMS"/>
            <Configuration />
        </telerik:RadFileExplorer>

I also went to the point of adding the following to my web.config

 

<location allowOverride="true" path="~/Admin"> 
  <system.web>
    <trust level="Full" originUrl="" />
  </system.web>
</location>


with no result.


3 Answers, 1 is accepted

Sort by
0
mac
Top achievements
Rank 1
answered on 26 Nov 2010, 11:59 PM
I would like to contribute further testing I have performed thus far and learned from my ISP
The site is running in IIS7 in a cloud environment under MEDIUM TRUST.

I have moved the whole thing to an IIS 6.0 box and had it work 100%.
I would really like to get this resolved.
Thank you and happy thanksgiving.

PS: I have tested this with URLRewriter on and off and no result difference.
0
Accepted
Fiko
Telerik team
answered on 30 Nov 2010, 05:29 PM
Hi Mac,

The problem that you experience is a permission issue with the permissions on the server. Please note that, however, I do not know the configuration of hosting server and cannot provide you with a definitely working solution.
I suggest you to run this test in order to determine the exact problem:
  • Remove the RadFileExplorer (or all RadControls) from the page
  • In the code behind of the same page where the RadFileExplorer was declared add this code:
    private void FillPermissionsTest(string testPhysicalPath)
    {
        try
        {
            string physicalPathToTestFolder = System.IO.Path.Combine(testPhysicalPath, "TestDirectory");
            System.IO.DirectoryInfo testDir = System.IO.Directory.CreateDirectory(physicalPathToTestFolder);// Create folder
            testDir.GetDirectories();// List folders
            string testFilePath = System.IO.Path.Combine(testDir.FullName, "TestFile1.txt");// test file paths
            System.IO.File.Create(testFilePath).Close();// Create a file
            testDir.GetFiles("*.*");// List files
            System.IO.File.OpenRead(testFilePath).Close();// Open a file
            System.IO.File.Delete(testFilePath);// delete the test file
            System.IO.Directory.Delete(physicalPathToTestFolder);// delete the test folder
        }
        catch (Exception ex)
        {// Show the probelm
      
            string message = ex.Message;
            string script = string.Format("alert('{0}');", message.Replace("'", @""""));
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "KEY", script, true);
        }
    }
  • The "Paths" string should be replaced with the paths that are set to the ViewPaths, UploadPaths and DeletePaths properties of the RadFileExplorer. You can use Server.MapPath in order to retrieve the in order to get the physical paths (for example: Server.MapPath("~/App_Data/ExampleVirtualPath")), because these methods accept physical path, not virtual.
  • Call this method in the Page_Load event (please make sure that the code is executed)
  • If an exception is thrown, then the text of the message will be shown (the value of the ex.Message property) as a JavaScript box

Could you please perform this test? In case that an exception is thrown, then I recommend you to change the permissions (or ask the administrator to grant the appropriate permissions) of the folders based on the information provided in the error message.


Regards,
Fiko
the Telerik team
Browse the vast support resources we have to jumpstart 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.
0
mac
Top achievements
Rank 1
answered on 30 Nov 2010, 07:23 PM
Hi Fiko
I was just coming in to close this ticket as indeed it was due to the hosting company running a medium/medium high custom trust level.
Good debug solution by the way. I get lazy sometimes and forget the System.IO.
Thanks for your assist and tips.
Mac
Tags
FileExplorer
Asked by
mac
Top achievements
Rank 1
Answers by
mac
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or