API ReferenceinterfacesUploadcoreoptions

upload-with-progress


Defined in: src/browser/core.ts:42

Core configuration shared by both useUpload and useMultipleUpload. Each hook extends this with hook-specific options.

Extended by

Properties

allowedTypes?

optional allowedTypes: string[]

Defined in: src/browser/core.ts:54

Allowed MIME types (e.g. ["image/png", "image/jpeg"]). Supports wildcard subtypes such as "image/*".

Default

undefined — all types allowed

headers?

optional headers: Record<string, string>

Defined in: src/browser/core.ts:81

Extra headers to send with the PUT request. Content-Type is set automatically from the file’s MIME type unless you provide an explicit Content-Type key here.


maxFileSize?

optional maxFileSize: number

Defined in: src/browser/core.ts:47

Maximum allowed file size in bytes.

Default

Infinity

retries?

optional retries: number

Defined in: src/browser/core.ts:67

Number of automatic retries on transient failures: network errors, timeouts, HTTP 429, and HTTP 5xx.

Default

0

retryDelay?

optional retryDelay: number

Defined in: src/browser/core.ts:74

Base delay in ms for exponential back-off between retries. Actual delay = retryDelay × 2^attempt (capped at 30 s).

Default

1000

signal?

optional signal: AbortSignal

Defined in: src/browser/core.ts:88

An AbortSignal for external cancellation (e.g. from an AbortController, React Query, or TanStack Query). When the signal fires, the in-flight XHR is aborted immediately. Works alongside the hook’s built-in abort() method.


timeout?

optional timeout: number

Defined in: src/browser/core.ts:60

Upload timeout in milliseconds. Set to 0 to disable.

Default

0