Removing WebApplication folder form image path

4 posts, 1 answers
  1. idwaikat
    idwaikat avatar
    25 posts
    Member since:
    Mar 2009

    Posted 10 May 2009 Link to this post

    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



  2. Answer
    Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 11 May 2009 Link to this post

    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.
  3. idwaikat
    idwaikat avatar
    25 posts
    Member since:
    Mar 2009

    Posted 11 May 2009 Link to this post

    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
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 14 May 2009 Link to this post

    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.
Back to Top