FileDrop

View source

Captures the files supplied by a browser file-drop event.

path references DragEvent.dataTransfer.files. When the event has no data transfer or file list, the value is an empty FileList.

Examples

const drop = new FileDrop(event)
for (const file of drop.path) console.log(file.name)

Constructor


constructor(event: DragEvent)

View source

Copies the browser event’s file list into path.

Parameters

NameDescriptionDefault
event

Browser file-drop event to capture.

—

Properties


readonlypath: FileList

View source

Files copied from dataTransfer.files, or an empty FileList when the browser event does not provide a data transfer or files.