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

Path document manager

5 Answers 161 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Luc Émond
Top achievements
Rank 1
Luc Émond asked on 16 Nov 2011, 02:59 PM
Hi,

I am using the rad editor and i need the use the docuement manager in the editor.
I want to path like this one \\Telerik.com\Path\SharedDir\ROOT\Folder_1\

If run my share drive trought run in windows i have acces not problem.

When i use it in the editor and click on the document manager there nothing showing!

What i am missing?

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
       Dim viewPaths As String() = New String() {"C:\PhysicalSource\ROOT", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\"}
Dim uploadPaths As String() = New String() {"C:\PhysicalSource\ROOT\CanUpload", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\"}
Dim deletePaths As String() = New String() {"C:\PhysicalSource\ROOT\Folder_1\CanDelete", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\"}
    End Sub

In asp

<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Nov 2011, 03:13 PM
Hi Luc,

1) You can test the permissions using the code provided in the An error like "... because the application did not have enough permissions..." occurs only in a production environment. How to debug the issue? section of this article: Troubleshooting.

2) Have you made the needed changes to the MappingFile.mapping file as shown in this article: Use RadFileExplorer with physical and shared folder's paths?


Kind regards,
Rumen
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
Luc Émond
Top achievements
Rank 1
answered on 16 Nov 2011, 03:25 PM
Hi,

Tks for the quick reply!
I i will test the permission!

If i try to map with the folling code

I get an error on this line  RadFileExplorer1.Configuration.SearchPatterns = New () {"*.*"}
Type excepeted

One question :
Dim deletePaths As String() = New String() {"C:\PhysicalSource\ROOT\Folder_1\CanDelete", "\\Telerik.com\Path\SharedDir\ROOT\Folder_1\CanDelete"}

This line i need to change this part C:\PhysicalSource\ROOT\Folder_1\CanDelete to my drive  on the server for the ?
Tks
Luc
0
Luc Émond
Top achievements
Rank 1
answered on 16 Nov 2011, 03:46 PM
Hi,

I try this to check for the persmission!

When i run my page on the server i don't get any error, but the file TestFile1.txt is not created on the server?
Any idea?

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim paths As String() = New String() {"E:\xxx\xxx\documentpartager", "\\xxx@SSL\DavWWWRoot\xxx\xxx\SGLD\documentpartager"} ' Path to test

        'RadFileExplorer1.Configuration.ViewPaths = paths;
        'RadFileExplorer1.Configuration.DeletePaths = paths;
        'RadFileExplorer1.Configuration.UploadPaths = paths;

        FullPermissionsTest(Server.MapPath(paths(0))) ' Pass physical path
    End Sub

    ''' <summary>
    ''' Full permission test
    ''' </summary>
    ''' <param name="testPhysicalPath">Physical path</param>
    ''' <remarks></remarks>
    Private Sub FullPermissionsTest(ByVal testPhysicalPath As String)
        Try
            Dim physicalPathToTestFolder As String = System.IO.Path.Combine(testPhysicalPath, "TestDirectory")
            Dim testDir As System.IO.DirectoryInfo = System.IO.Directory.CreateDirectory(physicalPathToTestFolder) 'Create folder
            testDir.GetDirectories() ' List folders
            Dim testFilePath As String = 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 ex As Exception
            ' Show the probelm
            Dim message As String = ex.Message
            Dim script As String = String.Format("alert('{0}');", message.Replace("'", """"))
            ScriptManager.RegisterStartupScript(Me.Page, Me.Page.[GetType](), "KEY", script, True)
        End Try
    End Sub

0
Luc Émond
Top achievements
Rank 1
answered on 16 Nov 2011, 06:10 PM
Any idea?
0
Dobromir
Telerik team
answered on 21 Nov 2011, 01:07 PM
Hello Luc,

Straight to the issues:
  1. I get an error on this line  RadFileExplorer1.Configuration.SearchPatterns = New () {"*.*"}
    Type excepeted

    The error message is pretty self explanatory - the type declaration of the newly created array is missing:
    RadFileExplorer1.Configuration.SearchPatterns = New String() {"*.*"}
  2. I am not quite sure why you are able to run the provided code snippet without receiving any errors. The following line should throw an exception:
    FullPermissionsTest(Server.MapPath(paths(0)))
    The Server.MapPath() method expects virtual path, where the value of paths(0) is a physical path. This line should be modified to pass the value of paths(0) directly to the FullPermissionsTest() method, e.g:
    FullPermissionsTest(paths(0))

Correct me if I am wrong but I believe the both paths set to the RadFileExplorer point to the same folder, where the first value is the path pointing to the Mapped Network Drive and the second value is the actual network path. If this is the case, you do not need to have both paths set but you need to add the mapping in the mapping file (MappingFile.mapping located in the App_Code folder). Here is how the new declaration should look:
<Mapping>
  <PhysicalPath>
    <![CDATA[\\xxx@SSL\DavWWWRoot\xxx\xxx\SGLD\documentpartager]]>
  </PhysicalPath>
  <VirtualPath><![CDATA[MyCusomRootDir 1/]]></VirtualPath>
</Mapping>

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
Tags
Editor
Asked by
Luc Émond
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Luc Émond
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or