We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to get file name on selection of the file .(Asp.net MVC)



Please see below code for your reference:-


@Html.EJ().FileExplorer("fileExplorer").FileTypes("*.pdf,*.png, *.gif, *.jpg, *.jpeg, *.docx").Path("~/content/images/FileExplorer/").AjaxAction(@Url.Content("/FileExplorer/FileActionDefault")).Width("900px").Height("400px").IsResponsive(true).EnableRTL(false).ShowThumbnail(false)

Thanks for your Help.....
Abhijeet 

1 Reply

KR Karthik Ravichandran Syncfusion Team December 20, 2016 10:47 AM UTC

Hi Abhijeet, 
  
Thanks for contacting Syncfusion support. 
  
We have analyzed your query. You can achieve your requirement (“How to get File name on selection of the file”) by using “Select” event of “FileExplorer” control. Please refer the below code block. 
  
     @Html.EJ().FileExplorer("fileExplorer").FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx") 
        .Path("~/content/images/FileExplorer/") 
        .AjaxAction(@Url.Content("/FileExplorer/FileActionDefault")) 
        .Width("900px") 
        .Height("400px") 
        .IsResponsive(true) 
        .EnableRTL(false) 
        .ShowThumbnail(false) 
        .ClientSideEvents(evt => evt.Select("onfileselect")) 
  
  
[Script] 
  
function onfileselect(args) { 
alert(args.name); 
} 
  
  
  
  
  
For your convenience, we have prepared the sample and it can be downloaded from the following location

sample
 
For more details on FileExplorer “Select” event, please refer the below documentation ink: 
  

Please let us know if you require any further assistance.
 
  
Regards, 
Karthik R 


Loader.
Live Chat Icon For mobile
Up arrow icon