Forced Download

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    8 posts
    Member since:
    Aug 2010

    Posted 12 Aug 2010 Link to this post

    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">















    function OnClientFileOpen(oExplorer, args) {




    var item = args.get_item();












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


    document.location = requestImage;


















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




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






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

  2. Fiko
    Fiko avatar
    1406 posts

    Posted 18 Aug 2010 Link to this post

    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.

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top