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

How to pass headers(httpHeader) in kendoupload component.

2 Answers 658 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Sushant
Top achievements
Rank 1
Veteran
Sushant asked on 05 Oct 2020, 04:45 AM
How to pass headers(httpHeader) in kendoupload component in angular 8 with example.

Thanks,
Sushant 

2 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 06 Oct 2020, 06:09 AM

Hi Sushant,

A possible way to send headers or any other additional information with the uploaded file/files, when Upload component is used, is to capture the upload built-in event. Please check this article from our documentation for more details and exmaples:

https://www.telerik.com/kendo-angular-ui/components/uploads/api/UploadEvent/

I hope this helps.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Sushant
Top achievements
Rank 1
Veteran
answered on 06 Oct 2020, 06:51 AM
Hi Martin,
It's working as expected.
Code:
 upload(e:UploadEvent) {
    e.headers = new HttpHeaders({
      hdr1: this.appContext.hdr,
      hdr2: this.header2,
    });
  }

Thanks & regards,
Sushant
Tags
Upload
Asked by
Sushant
Top achievements
Rank 1
Veteran
Answers by
Martin
Telerik team
Sushant
Top achievements
Rank 1
Veteran
Share this question
or