Bar Gans
Bar Gans

Reputation: 1683

how to convert ngx-file-drop UploadFile to File object in angular?

I drag a PDF file from my computer using ngx-file-drop.

The object I get is UploadEvent, does anyone know how I can convert it to an File object?

Upvotes: 1

Views: 2713

Answers (1)

Dimanoid
Dimanoid

Reputation: 7289

Read the docs. There is a plain and simple example. https://www.npmjs.com/package/ngx-file-drop

public dropped(event: UploadEvent) {
    this.files = event.files;
    for (const droppedFile of event.files) {
...
    }
}

Upvotes: 1

Related Questions