Downloading previously uploaded files / default file template location

4 posts, 1 answers
  1. Richard
    Richard avatar
    10 posts
    Member since:
    Aug 2013

    Posted 05 Nov 2013 Link to this post

    I am using the Files method of the Upload widget to show previously uploaded files and would like to make these files downloadable (by clicking the file name).

    The approach I planned on taking was to modify the default file template to invoke a JS script method when the filename is clicked. Where is the default file template located?

    Alternatively, is there a better way to accomplish this?
  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2211 posts

    Posted 06 Nov 2013 Link to this post

    Hi Richard,


    The default template is not exposed, since it is built and modified on demand. Nevertheless adding a link to a custom template, which will serve as a download link for the file should not be a problem.
     
    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Lawrence
    Lawrence avatar
    14 posts
    Member since:
    Jul 2013

    Posted 02 Aug Link to this post

    What about this...

    $(document).ready(function() {
        $(".k-file-name").css("cursor", "pointer");
        $(".k-file-name").click(function(e) {
            var fileName = this.innerText;
            alert(fileName);
        });
    });
  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1213 posts

    Posted 03 Aug Link to this post

    Hello,

    Using the ".k-file-name" class, which is applied to a span element rendered for every file within the Upload's file list, is a valid way to handle a click on file name in the file list.

    Regards,
    Ivan Danchev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top