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

Show full URL to selected file

2 Answers 54 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 06 Apr 2020, 03:32 PM

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 Answers, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 2
answered on 06 Apr 2020, 06:39 PM

 

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>

 

 

 

 

 

0
Vessy
Telerik team
answered on 07 Apr 2020, 06:40 PM

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.
Tags
FileExplorer
Asked by
Joel
Top achievements
Rank 2
Answers by
Joel
Top achievements
Rank 2
Vessy
Telerik team
Share this question
or