Hi,
I am using kendo-upload an I am looking for the option to view the file after the user uploads it, I want to be able to click on the file name and the file will then be displayed/ downloaded.
Is there any way to get this behaviour?
Thank you!
5 Answers, 1 is accepted
0
Hello Hadas,
A possible way to achieve this is to bind the uploaded files via ngModel - this way there will be no need to download the file after it has been uploaded in order to display it. Displaying the file could be achieved via file reader on the client side. Here is an example of this in action, in which I used the following resources of the documentation:
File templates - https://www.telerik.com/kendo-angular-ui/components/upload/templates/
Model binding - https://www.telerik.com/kendo-angular-ui/components/upload/model-binding/
Regards,
Dimiter Madjarov
Progress Telerik
A possible way to achieve this is to bind the uploaded files via ngModel - this way there will be no need to download the file after it has been uploaded in order to display it. Displaying the file could be achieved via file reader on the client side. Here is an example of this in action, in which I used the following resources of the documentation:
File templates - https://www.telerik.com/kendo-angular-ui/components/upload/templates/
Model binding - https://www.telerik.com/kendo-angular-ui/components/upload/model-binding/
Regards,
Dimiter Madjarov
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

Hadas
Top achievements
Rank 1
answered on 05 Nov 2018, 10:58 AM
Thank you for you reply.
Your example only works for a .jpg file... I need to be able to upload all file types (and display them), can you advice how to do it?
Thanks in advance
0
Hi Hadaz,
The FileReader could be used to read the content of any file type by using the appropriate method
https://developer.mozilla.org/en-US/docs/Web/API/FileReader#Methods
but displaying the content would be strictly specific and will most probably require a third party library to achieve it.
Regards,
Dimiter Madjarov
Progress Telerik
The FileReader could be used to read the content of any file type by using the appropriate method
https://developer.mozilla.org/en-US/docs/Web/API/FileReader#Methods
but displaying the content would be strictly specific and will most probably require a third party library to achieve it.
Regards,
Dimiter Madjarov
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

Hadas
Top achievements
Rank 1
answered on 13 Nov 2018, 07:07 AM
I am wondering if there is another way to accomplish this without overriding / changing the telerik template?
If that's not possible can we have the html for telerik template so I can use it in my code and just add the click event ?
Thanks
0
Hi Hadas,
Indeed, some custom implementation will be needed in order to achieve the desired behavior. You can check the source code of any Kendo Ui for Angular package by following the instructions on the following page:
https://www.telerik.com/kendo-angular-ui/components/installation/source-code/
Regards,
Svetlin
Progress Telerik
Indeed, some custom implementation will be needed in order to achieve the desired behavior. You can check the source code of any Kendo Ui for Angular package by following the instructions on the following page:
https://www.telerik.com/kendo-angular-ui/components/installation/source-code/
Regards,
Svetlin
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.