Articles in this section

How to download a file on double-clicking action?

In FileExplorer component, the built-in download option has been provided for Toolbar or ContextMenu download-click operation. You can customize this download operation on double clicking the file in FileExplorer using the beforeOpen event. The following code sample demonstrates how to download a file on double clicking action.

 

@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).ClientSideEvents(evt=>evt.BeforeOpen("OnBeforeDownload"))

 

function OnBeforeDownload(args) {
        if (args.itemType == "File") {
            args.cancel = true;
            this._downloadFile();
        } 
 }

 

Sample: https://www.syncfusion.com/downloads/support/directtrac/194516/ze/DoubleClick1983122364.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied