New to Kendo UI for Angular? Start a free 30-day trial

Saving Files on the Server

The Excel Export component enables you to send the generated Excel file to a remote service.

To save a file on the server:

  1. Use the toDataURL method to get the base64-encoded contents.
  2. Post the contents to the server.

import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { products } from './products';

    selector: 'my-app',
    template: `
        <button type="button" (click)="save(excelexport)">Save</button>
        <kendo-excelexport [data]="data" [fileName]="fileName" #excelexport>
            <kendo-excelexport-column field="ProductID">
            <kendo-excelexport-column field="ProductName">
export class AppComponent {

    public data: any[] = products;

    public fileName: string = "Products.xlsx";

    constructor(private http: HttpClient) {

    public save(component: any): void {
        component.toDataURL().then((dataURL: string) => {
            const base64 = dataURL.split(";base64,")[1];

  , {
                base64: base64,
                fileName: this.fileName

In this article

Not finding the help you need?