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

unable to close popup window on File download

3 Answers 43 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Sapandeep
Top achievements
Rank 1
Sapandeep asked on 29 Nov 2018, 01:55 PM

I am using custom FileSystemContentProvider class for FileExplorer's ContentProviderTypeName configuration.

I am using HTTPHandler to download files on double click on Files .

When double Clicked it opens files to download but it also opens a RadWindow . is there way to stop the popup and get the files downloaded directly?

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 30 Nov 2018, 03:46 PM
Hi Sapandeep,

You can prevent the showing of the default Preview window by cancelling the event arguments of the OnClientFileOpen event. Such approach is demonstrated in the following demo:
https://demos.telerik.com/aspnet-ajax/fileexplorer/examples/applicationscenarios/filteranddownloadfiles/defaultcs.aspx

function OnClientFileOpen(oExplorer, args) {
    var item = args.get_item();
    var fileExtension = item.get_extension();
 
    var fileDownloadMode = global.getDownloadCheckbox().checked;
    if ((fileDownloadMode == true) && (fileExtension == "jpg" || fileExtension == "gif")) {// Download the file
        // File is a image document, do not open a new window
        args.set_cancel(true);
 
        // Tell browser to open file directly
        var requestImage = "Handler.ashx?path=" + item.get_url();
        document.location = requestImage;
    }
}


Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sapandeep
Top achievements
Rank 1
answered on 03 Dec 2018, 10:08 PM

Thanks Vessy.  solution worked.

 

 

0
Vessy
Telerik team
answered on 04 Dec 2018, 07:01 AM
Hi,

You are welcome, Sapandeep - I am glad everything is working properly now :)

Regards,
Vessy
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
FileExplorer
Asked by
Sapandeep
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Sapandeep
Top achievements
Rank 1
Share this question
or