Show full URL to selected file

3 posts, 0 answers
  1. Joel
    Joel avatar
    181 posts
    Member since:
    Oct 2006

    Posted 06 Apr Link to this post

    My users need to copy and paste a link to their file that we would like to use fileexplorer to manage.

    Is there an event where this could be shown perhaps outside of the control , or in the path bar?

     

    Example:

    Path bar currently shows user  "/MyFiles/"  when "My Picture.jpg" is selected

    I would like to show  "https://www.foo.com/abx345/MyFiles/My%20Picture.jpg" somewhere on the page.  It doesn't matter if it is inside the control or outside.

     

    Thanks.

     

  2. Joel
    Joel avatar
    181 posts
    Member since:
    Oct 2006

    Posted 06 Apr Link to this post

     

    For future reader reference

     

    <telerik:RadFileExplorer runat="server" ID="rfm" AllowPaging="false" Skin="Bootstrap"
                         OnClientItemSelected="OnClientItemSelected">
                 <Configuration  MaxUploadFileSize="5242880"></Configuration>
     </telerik:RadFileExplorer>
     
     
      <script type="text/javascript">
                   function OnClientItemSelected(sender, args) {
                       if (args.get_item().get_type() == Telerik.Web.UI.FileExplorerItemType.File)
                       {
                           // if the item is a file       
                           var file = "https://www.foo.com/something/" + args.get_item().get_path() + "\n";
                          file = file.split(" ").join("%20");
                           document.getElementById('lblDispPath').innerText = file;
                       }
                   }
               </script>

     

     

     

     

     

  3. Vessy
    Admin
    Vessy avatar
    2191 posts

    Posted 07 Apr Link to this post

    Hi,

    Thanks a lot for the shared solution, Joel - I am sure it will be helpful for the other users in the community.

    Regards,
    Vessy
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top