UNPKG

@progress/kendo-angular-upload

Version:

Kendo UI Angular Upload Component

50 lines (49 loc) 1.62 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { PreventableEvent } from './preventable-event'; /** * Arguments for the `upload` event. The `upload` event fires when you are about * to upload one or more files. You can cancel this event to prevent upload and add headers to the request. * * ```typescript * @Component({ * template: ` * <kendo-upload (upload)="uploadEventHandler($event)"></kendo-upload> * ` * }) * export class UploadComponent { * public uploadEventHandler(e: UploadEvent) { * e.headers = e.headers.append('X-Foo', 'Bar'); * } * } * ``` */ export class UploadEvent extends PreventableEvent { /** * The optional object that you send to the `upload` handler as key/value pairs. * */ data; /** * The files that you will upload to the server. */ files; /** * The headers of the request. * You can use this to add custom headers to the upload request. */ headers; /** * @hidden * Constructs the event arguments for the `upload` event. * @param files - The list of the files that will be uploaded. * @param headers - The headers of the request. */ constructor(files, headers) { super(); this.files = files; this.headers = headers; } }