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

Forced Download

1 Answer 130 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 13 Aug 2010, 03:39 AM

When using FileExplorer control, I would like to force a download of any files double clicked on, regardless of the type.  I believe the following code (which I took from the sample code) should do the trick:

 

 

 

<script type="text/javascript">

 

 

 

 

 

 

//<![CDATA[

 

 

 

 

 

 

 

function OnClientFileOpen(oExplorer, args) {

 

 

 

var item = args.get_item();

 

args.set_cancel(

 

true);

 

 

 

 

 

 

 

var requestImage = "Handler.ashx?path=" + item.get_url();

 

document.location = requestImage;

}

 

 

//]]>

 

 

 

 

</script>

 

 

 

 

 

 

 

 

<telerik:RadFileExplorer ID="fileExplorer" runat="server" Width="700px" OnClientFileOpen="OnClientFileOpen" EnableOpenFile="true" TreePaneWidth="250px">

 

 

 

<Configuration SearchPatterns="*.*" MaxUploadFileSize="20480000"></Configuration>

 

 

 

</telerik:RadFileExplorer>.

 

However, I get the error message that Handler.ashx doesn't exists.

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 18 Aug 2010, 11:58 AM
Hello Thomas,

If you have RadControls for ASP.NET AJAX installed on your machine, then the Handler.ashx file is located in the "C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX <VERSION>\Live Demos\FileExplorer\Examples\FilterAndDownloadFiles" folder.

For your convenience I have attached it to this thread as well.

I hope this helps.

Greetings,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
FileExplorer
Asked by
Thomas
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or