Skip to main content
The option and record types the rest of these docs refer to, and the upload phases named in error messages.

Size

A byte count, never a bit count. A bare number is bytes. String units ignore case, so MB and mb both mean megabytes. For a 32 MiB file limit, use "32MiB" or 33_554_432. A "32MB" limit is smaller and rejects that file. Existing decimal units keep their values. Bit units such as mbit and Mbps are not supported. An unparseable size throws a TypeError where the option is written, not per request. A limit you write by hand takes a Size: maxSize, multipart. A measurement you forward is a plain number of bytes: the size option on put, and every size the SDK returns. That mirrors File.size and Blob.size, so a value flows from one to the other without conversion. formatBytes, exported from all three entrypoints, always displays decimal byte units, including values supplied as MiB: formatBytes(2_400_000) is 2.4 MB.

Duration

A span of time. A bare number is seconds; a string takes a unit: ms, s, m, h, d, or a long form (sec, seconds, min, minutes, hr, hours, day, days). A string with no unit is seconds. An unparseable duration throws a TypeError naming the option.

CacheOption

One of three words, a Duration, or a raw Cache-Control header. The header each one stores is on Caching.

Records

Four record shapes come back from the SDK. They nest. BlobObject fields: Across the SDK, blob names a record, never the bytes. Bytes go in and come out as body.

Upload phases

A direct browser upload makes up to four kinds of request to your upload route. The names appear in error messages and across these docs. The PUTs that carry the bytes go to storage, never to your route. How signing works has the full handshake.