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

Downloading previously uploaded files / default file template location

3 Answers 297 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 06 Nov 2013, 02:33 AM
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?

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 06 Nov 2013, 11:09 AM
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!
0
Lawrence
Top achievements
Rank 2
Iron
answered on 02 Aug 2017, 03:19 PM

What about this...

$(document).ready(function() {
    $(".k-file-name").css("cursor", "pointer");
    $(".k-file-name").click(function(e) {
        var fileName = this.innerText;
        alert(fileName);
    });
});
0
Ivan Danchev
Telerik team
answered on 03 Aug 2017, 01:44 PM
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.
Tags
Upload
Asked by
Richard
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Lawrence
Top achievements
Rank 2
Iron
Ivan Danchev
Telerik team
Share this question
or