Skip to content

basalt / http/src / UploadOptions

Interface: UploadOptions ​

Defined in: http/src/upload.ts:8

Limits for a upload route body. maxBytes and maxFiles are required on purpose.

Properties ​

allowedTypes? ​

> optional allowedTypes?: readonly string[]

Defined in: http/src/upload.ts:26

Accepted declared content types of FILE parts — exact (image/png) or a wildcard subtype (image/*). Anything else: 415. Default: any. This is the client's claim, not the bytes' — sniff the content before trusting it.


maxBytes ​

> maxBytes: number

Defined in: http/src/upload.ts:10

Most bytes the whole request body may carry (multipart framing included). Over it: 413.


maxFieldBytes? ​

> optional maxFieldBytes?: number

Defined in: http/src/upload.ts:18

Most bytes one field value may carry. Default: 64 KiB. Over it: 413.


maxFields? ​

> optional maxFields?: number

Defined in: http/src/upload.ts:16

Most non-file fields accepted. Default: 50. One more: 400 TOO_MANY_FIELDS.


maxFileBytes? ​

> optional maxFileBytes?: number

Defined in: http/src/upload.ts:14

Most bytes a single file may carry. Default: maxBytes. Over it: 413.


maxFiles ​

> maxFiles: number

Defined in: http/src/upload.ts:12

Most file parts accepted. One more: 400 TOO_MANY_FILES.


maxHeaderBytes? ​

> optional maxHeaderBytes?: number

Defined in: http/src/upload.ts:20

Most bytes of one part's header block. Default: 8 KiB. Over it: 400.

Released under the MIT License.