# XhrUploaderOptions (@salmonui/inputs/file-upload/xhr)

> The XhrUploaderOptions interface of @salmonui/inputs/file-upload/xhr.

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

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

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

## Reference

Kind: interface

```ts
interface XhrUploaderOptions {
    readonly url: string | ((file: File) => string);
    readonly method?: string | undefined;
    readonly headers?: Readonly<Record<string, string>> | ((file: File) => Readonly<Record<string, string>>) | undefined;
    readonly fieldName?: string | undefined;
    readonly data?: Readonly<Record<string, string>> | ((file: File) => Readonly<Record<string, string>>) | undefined;
    readonly withCredentials?: boolean | undefined;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `url` | `readonly url: string \| ((file: File) => string);` |  | Target URL, or a function of the file. |
| `method` | `readonly method?: string \| undefined;` | optional | Default `'POST'`. |
| `headers` | `readonly headers?: Readonly<Record<string, string>> \| ((file: File) => Readonly<Record<string, string>>) \| undefined;` | optional | Request headers, or a function of the file (auth tokens, CSRF). |
| `fieldName` | `readonly fieldName?: string \| undefined;` | optional | Multipart field name of the file. Default `'file'`. |
| `data` | `readonly data?: Readonly<Record<string, string>> \| ((file: File) => Readonly<Record<string, string>>) \| undefined;` | optional | Extra multipart fields sent with each file. |
| `withCredentials` | `readonly withCredentials?: boolean \| undefined;` | optional | Sends cookies cross-origin. Default `false`. |
