Skip to content

MimeGroupedFiletypeOptions

MimeGroupedFiletypeOptions<TInput> = object

Defined in: packages/storage/src/types.ts:77

Options for the per-mime form of filetype — all the fields you’d set on a FiletypeConfig except accept and maxSize, which are derived from the MIME groups.

TInput = Record<string, unknown>

bucket: string

Defined in: packages/storage/src/types.ts:79

R2 binding name from the Workers environment (e.g. "UPLOADS").


optional hooks: FiletypeHooks<TInput>

Defined in: packages/storage/src/types.ts:93

Lifecycle hooks that run before and after upload.


key: (file, ctx) => string

Defined in: packages/storage/src/types.ts:81

Function that generates the R2 object key for an uploaded file.

string

string

KeyContext<TInput>

string


optional multipartThreshold: string

Defined in: packages/storage/src/types.ts:87

File size above which multipart upload is used (default "5mb").


optional ownerCheck: OwnerCheck

Defined in: packages/storage/src/types.ts:95

Access-control gate used by the /uploads/* proxy route.


optional partSize: string

Defined in: packages/storage/src/types.ts:89

Size of each part in a multipart upload (default "10mb").


optional publicUrl: string

Defined in: packages/storage/src/types.ts:91

Base URL for publicly accessible files (used by getPublicUrl).


optional replace: boolean

Defined in: packages/storage/src/types.ts:83

When true, uploading replaces all existing files under the same key prefix.


optional uploadable: boolean

Defined in: packages/storage/src/types.ts:85

When false, the file type cannot be uploaded directly (e.g. system-generated exports).