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

Removing WebApplication folder form image path

3 Answers 77 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
idwaikat
Top achievements
Rank 2
idwaikat asked on 10 May 2009, 11:47 AM
Hi all

I added FileExplorer to my web application, I am using "OnClientItemSelected" client event to get the selected file path as follows:

            var imgPath; 
 
            function OnClientItemSelected(sender, args) { 
             
            var imageSrc = args.get_path(); 
            imgPath = imageSrc; 
           ... 
           ... 
           ... 
        } 

and I am using the value of imgPath to save the path in TextBox and later I save it in the database.

The issue is that the value is such like this

/MyWebsite/Images/Icons/01.png

assume that I am now running the web application on:

http://localhost/MyWebstie

and later I will run it on:  [http://myserver/Website] or [http://www.mysite.com], so the file name will not be valid because it originally saved with [/MyWebsite].. I need a way to get the file name without [/MyWebsite]

(Splitting the path and removing [/MyWebsite] from it is not accepted because I may run the server on [http://localhost] directly and then move it to [http://www.mysite.com/myApplication])

I know that I must determine the domain before but I don't know where the application will run...

Thank you



3 Answers, 1 is accepted

Sort by
0
Accepted
Tervel
Telerik team
answered on 11 May 2009, 11:50 AM
Hi idwaikat,

Handling paths is a general programming task which goes beyond the scope of Telerik support - as it is not directly related to RadFileExplorer. The task of the explorer is to return a correct path in the current programming context.

When you upload your app to an actual server and run it under http://www.mysite.com, then the path returned by the method will fit this context too - it will be something like Images/Icons/01.png.

My suggestion is to test your site in production environment, and then - in case there are any problems - to let us know.

Best wishes,
Tervel
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
idwaikat
Top achievements
Rank 2
answered on 11 May 2009, 01:18 PM
Thanks alot.. I will do as you suggested..

I have a question about args object, how to know what is the other methods (other than args.get_path() ), not only for FileExplorer, but for all other controls, actually I searched Telerik website but I did not find a "documentation" that mentions these functions, just the examples uses some of them, can u help me please ..

Regards
0
Georgi Tunev
Telerik team
answered on 14 May 2009, 10:36 AM
Hi idwaikat,

We are currently working on the RadFileExplorer documentation and it will be ready for the service pack at the end of the month. For the time being you could use the debugger to see the available methods. As for the rest of the Telerik controls, there is a Programming / Client-side section of the documentation for every control where you could find the needed information.


Greetings,
Georgi Tunev
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.
Tags
FileExplorer
Asked by
idwaikat
Top achievements
Rank 2
Answers by
Tervel
Telerik team
idwaikat
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or