Put ViewPaths, UploadPaths on codebehind

13 posts, 0 answers
  1. Julien
    Julien avatar
    8 posts
    Member since:
    Jul 2008

    Posted 20 May 2009 Link to this post

    Hi people,

    I'm trying to put viewpaths, uploadPaths property on my codebehind like I do that with a radEditor and it doesn't seems to work.
    Here is a little test I'm trying to do :

    test.aspx :
    <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <div> 
            <telerik:RadEditor ID="RadEditor1" runat="server"
            </telerik:RadEditor> 
            <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server"
            </telerik:RadFileExplorer> 
        </div> 
    </form> 

    test.aspx.vb :
    Protected Sub Page_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.PreRender 
        activeFileBrowser() 
    End Sub 
     
    Protected Sub activeFileBrowser() 
            RadEditor1.ImageManager.ViewPaths = New String() {"/ImagesClients/" & chercheChemin() & "/Animation/"
            RadEditor1.ImageManager.UploadPaths = New String() {"/ImagesClients/" & chercheChemin() & "/Animation/"
            RadEditor1.ImageManager.DeletePaths = New String() {"/ImagesClients/" & chercheChemin() & "/Animation/"
     
            RadFileExplorer1.Configuration.ViewPaths = New String() {"/ImagesClients/" & chercheChemin() & "/Animation/"
            RadFileExplorer1.Configuration.UploadPaths = New String() {"/ImagesClients/" & chercheChemin() & "/Animation/"
            RadFileExplorer1.Configuration.DeletePaths = New String() {"/ImagesClients/" & chercheChemin() & "/Animation/"
    End Sub 

    When I launch the page :
    • I am able with the RadEditor to browse the image directory, upload, delete images, etc.
    • I can't browse the FileBrowser directory, not upload, not delete.

    Is there a mistake?
    Thank you,

    Julien

  2. Julien
    Julien avatar
    8 posts
    Member since:
    Jul 2008

    Posted 20 May 2009 Link to this post

    Nevermind about it, I put a "~" at the begining of all my pathes and it works now.

    Julien
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 22 May 2009 Link to this post

    Thanks for the example. But does anyone know how to setup multiple folders in code behind. I am trying this without success


               Dim folderstring As String = "~/images,~/data,~/banners"

                RadFileExplorer1.Configuration.ViewPaths = New String() {folderstring}
                RadFileExplorer1.Configuration.DeletePaths = New String() {folderstring}
                RadFileExplorer1.Configuration.UploadPaths = New String() {folderstring}

                RadFileExplorer1.DataBind()


    Thanks
  5. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 25 May 2009 Link to this post

    Hi Karl,

    The ViewPath property accepts a string array as a value and you can add several paths to that property by using the following approach :

            Dim folderstring1 As String = "~/images/" 
            Dim folderstring2 As String = "~/data/" 
            Dim folderstring3 As String = "~/banners/" 
            RadFileExplorer1.Configuration.ViewPaths = New String() {folderstring1, folderstring2, folderstring3} 

    The code above can be successfully applied to the DeletePaths and UploadPaths properties as well.

    I hope this helps.

    All the best,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Syed Furqan
    Syed Furqan avatar
    11 posts
    Member since:
    Jan 2009

    Posted 13 Jul 2009 Link to this post

    Hello,

    I am using Rad Editor. I am setting Paths as follows. It works on my localhost, but not on the server

            Dim newsImagesFolderPath As String = Server.MapPath("~/NewsImages/" & CurrentUser.Domain)
            Dim newsImagesFolderVirtualPath As String = "~/NewsImages/" & CurrentUser.Domain


            If Not FolderExists(newsImagesFolderPath) Then
                FolderCreate(newsImagesFolderPath)
            End If

            NewsEditor1.ImageManager.ViewPaths = New String() {newsImagesFolderVirtualPath}
            NewsEditor1.ImageManager.UploadPaths = New String() {newsImagesFolderVirtualPath}
            NewsEditor1.ImageManager.DeletePaths = New String() {newsImagesFolderVirtualPath}

    On the server its creating the folder at the right place also.


    If I try to upload any picture it gives ...

    404 - File or directory not found.

    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.



    Any idea whats wrong ?

    Furqan
  7. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 14 Jul 2009 Link to this post

    Hi Syed,

    We are aware of such behavior and it is caused by the set maxRequestLength and/or executionTimeout properties set in the Web.config file. Please note that this error is not thrown by the RadFileExplorer (or by the embedded Radupload control) control but by the ASP.NET Framework. Could you please check the above mentioned properties and make sure that the uploaded files do not exceeded the size set in the maxRequestLength. Additional information about the issue can be found on this help page.

    I hope this helps.

    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Syed Furqan
    Syed Furqan avatar
    11 posts
    Member since:
    Jan 2009

    Posted 16 Jul 2009 Link to this post

    Thanks Fiko for your reply.

    I have checked and I don't think so its an issue. I was trying to upload a file of 121 kb. But, when the image manager pop up appears, the loading panel on left most part (folder section) and in the middle part (files section) keeps loading something and I dont know what they are searching. And after that If I try to upload any picture it gives me above mentioned error.

    btw, in my web.config the configuration is
    maxRequestLength="102400" executionTimeout="3600"

    Hope now you get the scenario ..

    Furqan
  9. Syed Furqan
    Syed Furqan avatar
    11 posts
    Member since:
    Jan 2009

    Posted 21 Jul 2009 Link to this post

    Any hint .. whats wrong ?
  10. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 21 Jul 2009 Link to this post

    Hello Syed,

    We are not quite sure what may cause the problem in your case but we recommend you upgrade to the newest version of the controls - Q2 2009 where we fixed several issues with the RadFileExplorer control. In case that the issue still exists, please open a new support ticket and send us the project that reproduces the issue. We will debug it on our side and do out best to provide a working solution for you.

    Regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 23 Jul 2009 Link to this post

    Thanks - that works, but now I am struggling with how to dynamically do this. If client x has 4 folders we want to configure, and client y has 12, ideally we should be able to dynamically set this up, but your sample is fairly hard coded. Would you achieve the desired result with a dictionary?
  12. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 28 Jul 2009 Link to this post

    Hello Karl,

    I am not sure what sample you are referring to. Could you please open a new support ticket and send it to me. Just make sure that the example can be run locally and attach it to the support thread. I will check it and do my best to provide a solution for you.



    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  13. Sunil
    Sunil avatar
    1 posts
    Member since:
    Jul 2011

    Posted 16 Mar Link to this post

    Hi I am using , Radeditor version 2014.2.618.35 .

    I have a scenario - Where I wanted viewpath should be the last subsubsub folder When I reopen the image manager .

    Thanks

    Sunil

  14. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 18 Mar Link to this post

    Hi Sunil,

    The desired functionality is controlled by the InitialPath property in FileExplorer, which though is used in RdaEditor for the implementation of its navigate-to-selected-image functionality of the ImageManager.

    Optionally you can consider implementing a logic for resetting the InitialPath of FileExplorer in the Editor's FileBrowser.ascx dialog in the way described here:
    http://www.telerik.com/forums/imagemanager---custom-content-provider#Bb7xqkx62EWUrvnZ6wgKZA

    Regards,
    Vessy
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017