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

Put ViewPaths, UploadPaths on codebehind

12 Answers 393 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 20 May 2009, 02:34 PM
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

12 Answers, 1 is accepted

Sort by
0
Julien
Top achievements
Rank 1
answered on 20 May 2009, 03:13 PM
Nevermind about it, I put a "~" at the begining of all my pathes and it works now.

Julien
0
Karl Wilkens
Top achievements
Rank 1
answered on 22 May 2009, 01:48 PM
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
0
Fiko
Telerik team
answered on 25 May 2009, 03:39 PM
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.
0
Syed Furqan
Top achievements
Rank 1
answered on 13 Jul 2009, 09:15 AM
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
0
Fiko
Telerik team
answered on 14 Jul 2009, 03:13 PM
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.
0
Syed Furqan
Top achievements
Rank 1
answered on 16 Jul 2009, 03:16 PM
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
0
Syed Furqan
Top achievements
Rank 1
answered on 21 Jul 2009, 08:48 AM
Any hint .. whats wrong ?
0
Fiko
Telerik team
answered on 21 Jul 2009, 03:43 PM
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.
0
Karl Wilkens
Top achievements
Rank 1
answered on 23 Jul 2009, 12:30 PM
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?
0
Fiko
Telerik team
answered on 28 Jul 2009, 01:45 PM
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.
0
Sunil
Top achievements
Rank 1
answered on 16 Mar 2016, 06:56 AM

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

0
Vessy
Telerik team
answered on 18 Mar 2016, 04:24 PM
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.
Tags
FileExplorer
Asked by
Julien
Top achievements
Rank 1
Answers by
Julien
Top achievements
Rank 1
Karl Wilkens
Top achievements
Rank 1
Fiko
Telerik team
Syed Furqan
Top achievements
Rank 1
Sunil
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or