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

Not able to upload or Create new folder on folder depth >= 2

0 Answers 39 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Terrier Maxandre
Top achievements
Rank 1
Terrier Maxandre asked on 03 Mar 2011, 10:39 AM
Hi,

To start It's usefull to know that I'm a beginner with the radfileexplorer component :)

I have a problem with the radfileexplorer I use a customfileprovider to manage a folder on a distant network.

Sample code

 

 

 

Partial Public Class Plans
    Inherits System.Web.UI.Page
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
  
        Master.pgmCurrentMenu = "Plans"
        Master.InitBanner()
    End Sub
  
    Private Sub RadFileExplorer1_ExplorerPopulated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadFileExplorerPopulatedEventArgs) Handles RadFileExplorer1.ExplorerPopulated
        Dim result As List(Of FileBrowserItem) = New List(Of FileBrowserItem)
  
        For Each item In e.List
            If item.Name.ToUpper.Contains(TextBox1.Text.ToUpper) Then
                result.Add(item)
            End If
        Next
  
        e.List = result
    End Sub
    Private Sub RadFileExplorer1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadFileExplorerEventArgs) Handles RadFileExplorer1.ItemCommand
        Dim Utilisateur As String
        Dim Fichier As New Gestion_FichierUpload
        Utilisateur = Master.pgmInfoUser.Login
        Master.pgmCurrentMenu = "BEPLAN"
        Master.InitBanner()
        'MsgBox(e.Command.ToString)
        'MsgBox(e.NewPath.ToString)
        'MsgBox(e.Path.ToString)
        Select Case e.Command
            Case "UploadFile"
                If (e.Path = e.NewPath) Then
                    Fichier.Add_Fichier_Sql(e.Path.ToString, Utilisateur, "Ecraser")
                Else
                    Fichier.Add_Fichier_Sql(e.Path.ToString, Utilisateur, "Telecharger")
                End If
            Case "MoveDirectory"
                Fichier.Renommer_Dossier(e.Path, e.NewPath, Utilisateur)
            Case "CreateDirectory"
                Fichier.Add_Repertoire_Sql(e.Path.ToString & e.NewPath.ToString, Utilisateur)
            Case "DeleteFile"
                Fichier.Copie_Corbeille(e.Path, e.NewPath)
                Fichier.Supp_Fichier_Sql(e.Path, Utilisateur)
            Case "MoveFile"
                Fichier.Renommer_Fichier(e.Path, e.NewPath, Utilisateur)
            Case "DeleteDirectory"
                Fichier.Supp_Repertoire_Sql(e.Path.ToString, Utilisateur)
            Case Else
        End Select
  
  
        Dim viewPaths As String() = New String() {""}
  
        Dim test As New Gestion_FichierUpload
  
  
        If RadFileExplorer1.CurrentFolder <> "Donnees BE/" & RadComboBox1.SelectedValue.ToString And RadFileExplorer1.CurrentFolder IsNot Nothing Then
  
            Dim s1 As String = ""
  
            s1 = RadFileExplorer1.CurrentFolder
  
            viewPaths = New String() {RadFileExplorer1.CurrentFolder}
  
            RadFileExplorer1.Visible = True
            RadFileExplorer1.TreeView.Nodes.Clear()
            RadFileExplorer1.Configuration.ViewPaths = viewPaths
            RadFileExplorer1.Configuration.UploadPaths = viewPaths
            RadFileExplorer1.Configuration.DeletePaths = viewPaths
            RadFileExplorer1.TreeView.MaxDataBindDepth = 30
            RadFileExplorer1.DisplayUpFolderItem = True
            RadFileExplorer1.EnableCopy = True
            RadFileExplorer1.EnableCreateNewFolder = True
            RadFileExplorer1.Language = "fr-FR"
            RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000
            RadFileExplorer1.AllowPaging = True
            RadFileExplorer1.Visible = True
            RadFileExplorer1.InitialPath = s1
  
            RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName
  
  
        End If
  
        If RadComboBox1.SelectedValue <> Session.Item("ComboValue") Then
  
            Dim s1 As String = ""
  
            s1 = RadFileExplorer1.CurrentFolder
  
            Session.Clear()
            Session.Add("ComboValue", RadComboBox1.SelectedValue)
            viewPaths = New String() {test.Get_Repertoire(RadComboBox1.SelectedValue.ToString)}
            RadFileExplorer1.Visible = True
            RadFileExplorer1.TreeView.Nodes.Clear()
            RadFileExplorer1.Configuration.ViewPaths = viewPaths
            RadFileExplorer1.Configuration.UploadPaths = viewPaths
            RadFileExplorer1.Configuration.DeletePaths = viewPaths
            RadFileExplorer1.TreeView.MaxDataBindDepth = 30
            RadFileExplorer1.DisplayUpFolderItem = True
            RadFileExplorer1.EnableCopy = True
            RadFileExplorer1.Language = "fr-FR"
            RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000
            RadFileExplorer1.AllowPaging = True
            RadFileExplorer1.EnableCreateNewFolder = True
            RadFileExplorer1.InitialPath = s1
  
            RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName
  
  
  
        End If
  
  
  
  
  
    End Sub
    Private Sub RadFileExplorer1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadFileExplorer1.Load
  
        Dim viewPaths As String() = New String() {""}
  
        Dim test As New Gestion_FichierUpload
  
        Dim Utilisateur As String = Master.pgmInfoUser.Autorisation
  
  
        If IsPostBack Then
  
  
            If RadFileExplorer1.CurrentFolder <> "Donnees BE/" & RadComboBox1.SelectedValue.ToString And RadFileExplorer1.CurrentFolder IsNot Nothing Then
  
                Dim s1 As String = ""
  
                s1 = RadFileExplorer1.CurrentFolder
  
                viewPaths = New String() {RadFileExplorer1.CurrentFolder}
  
                RadFileExplorer1.Visible = True
                RadFileExplorer1.TreeView.Nodes.Clear()
                RadFileExplorer1.Configuration.ViewPaths = viewPaths
                RadFileExplorer1.Configuration.UploadPaths = viewPaths
                RadFileExplorer1.Configuration.DeletePaths = viewPaths
                RadFileExplorer1.TreeView.MaxDataBindDepth = 30
                RadFileExplorer1.DisplayUpFolderItem = True
                RadFileExplorer1.EnableCopy = True
                RadFileExplorer1.EnableCreateNewFolder = True
                RadFileExplorer1.Language = "fr-FR"
                RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000
                RadFileExplorer1.AllowPaging = True
                RadFileExplorer1.Visible = True
                RadFileExplorer1.InitialPath = s1
  
                RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName
  
  
            End If
  
            If RadComboBox1.SelectedValue <> Session.Item("ComboValue") Then
  
                Dim s1 As String = ""
  
                s1 = RadFileExplorer1.CurrentFolder
  
                Session.Clear()
                Session.Add("ComboValue", RadComboBox1.SelectedValue)
                viewPaths = New String() {test.Get_Repertoire(RadComboBox1.SelectedValue.ToString)}
                RadFileExplorer1.Visible = True
                RadFileExplorer1.TreeView.Nodes.Clear()
                RadFileExplorer1.Configuration.ViewPaths = viewPaths
                RadFileExplorer1.Configuration.UploadPaths = viewPaths
                RadFileExplorer1.Configuration.DeletePaths = viewPaths
                RadFileExplorer1.TreeView.MaxDataBindDepth = 30
                RadFileExplorer1.DisplayUpFolderItem = True
                RadFileExplorer1.EnableCopy = True
                RadFileExplorer1.Language = "fr-FR"
                RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000
                RadFileExplorer1.AllowPaging = True
                RadFileExplorer1.EnableCreateNewFolder = True
                RadFileExplorer1.InitialPath = s1
  
                RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName
  
  
  
            End If
  
        Else
  
            viewPaths = New String() {"Donnees BE/140"}
            RadFileExplorer1.TreeView.Nodes.Clear()
            RadFileExplorer1.Configuration.ViewPaths = viewPaths
            RadFileExplorer1.Configuration.UploadPaths = viewPaths
            RadFileExplorer1.Configuration.DeletePaths = viewPaths
            RadFileExplorer1.TreeView.MaxDataBindDepth = 30
            RadFileExplorer1.DisplayUpFolderItem = True
            RadFileExplorer1.EnableCopy = True
            RadFileExplorer1.EnableCreateNewFolder = True
            RadFileExplorer1.Language = "fr-FR"
            RadFileExplorer1.Configuration.MaxUploadFileSize = 100000000
            RadFileExplorer1.AllowPaging = True
            RadFileExplorer1.Visible = False
  
            RadFileExplorer1.Configuration.ContentProviderTypeName = GetType(CustomFileSystemProvider).AssemblyQualifiedName
  
  
        End If
  
  
    End Sub
  
    Private Sub TextBox1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Load
        TextBox1.AutoPostBack = True
    End Sub
  
    Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        TextBox1.AutoPostBack = True
  
  
    End Sub
    Private Sub RadComboBox1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadComboBox1.Load
  
  
        RecursiveSearch2("\\vm-cham-files2\Share$\Plans\PLANS BE\", RadComboBox1)
  
  
    End Sub
    Private Function RecursiveSearch2(ByVal path As String, ByVal Radcombobox As RadComboBox) As List(Of String)
  
        Dim repertoires As New List(Of String)
        Dim dirInfo As New IO.DirectoryInfo(path)
        Dim fileObject As FileSystemInfo
        Dim compteur As Integer = 0
  
        compteur = dirInfo.GetFileSystemInfos().Length
  
        For Each fileObject In dirInfo.GetFileSystemInfos()
  
            Dim rdcbbox As New RadComboBoxItem
  
            rdcbbox.Value = fileObject.Name
            rdcbbox.Text = fileObject.Name
  
            Radcombobox.Items.Add(rdcbbox)
        Next
  
        Return repertoires
    End Function
End Class


My main problem occurs when I try to upload or create new folder on nodes deeper than 2

Example:
        Folder1                          Buttons (Upload and CreateNewFolder) enabled
                    -Folder2                          Buttons (Upload and CreateNewFolder) enabled
                    -Folder3                          Buttons (Upload and CreateNewFolder) enabled
                                    -Folder4                        Buttons (Upload and CreateNewFolder) disabled
                                    -Folder5                        Buttons (Upload and CreateNewFolder) disabled


Thanx for your help

 

 

No answers yet. Maybe you can help?

Tags
FileExplorer
Asked by
Terrier Maxandre
Top achievements
Rank 1
Share this question
or