# FileUploadApi (@salmonui/inputs/file-upload)

> The FileUploadApi interface of @salmonui/inputs/file-upload: The ref of FileUpload.

Canonical: https://salmonui.dev/docs/reference/inputs/file-upload/FileUploadApi

```ts
import type { FileUploadApi } from '@salmonui/inputs/file-upload';
```

Entry index: https://salmonui.dev/docs/reference/inputs/file-upload (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/inputs/file-upload.md).

## Reference

Kind: interface

```ts
interface FileUploadApi {
    readonly element: HTMLDivElement | null;
    upload(ids?: readonly string[]): void;
    cancel(id: string): void;
    retry(id: string): void;
    remove(id: string): void;
    clear(): void;
    getFiles(): readonly FileEntry[];
    open(): void;
    focus(): void;
}
```

The `ref` of `FileUpload`.

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `element` | `readonly element: HTMLDivElement \| null;` |  | The root element. |
| `upload` | `upload(ids?: readonly string[]): void;` |  | Starts queued files (all, or the given ids). |
| `cancel` | `cancel(id: string): void;` |  |  |
| `retry` | `retry(id: string): void;` |  |  |
| `remove` | `remove(id: string): void;` |  |  |
| `clear` | `clear(): void;` |  | Removes every file (`onBeforeClear` can veto). |
| `getFiles` | `getFiles(): readonly FileEntry[];` |  |  |
| `open` | `open(): void;` |  | Opens the file picker. |
| `focus` | `focus(): void;` |  | Focuses the drop zone button. |
