# blob

> This document is the Markdown version of [valibot.dev/api/blob/](https://valibot.dev/api/blob/). For the complete documentation index, see [llms.txt](https://valibot.dev/llms.txt).

Creates a blob schema.

> The `Blob` class is not available by default in Node.js v16 and below.

```ts
const Schema = v.blob<TMessage>(message);
```

## Generics

- `TMessage` `extends ErrorMessage<BlobIssue> | undefined`

## Parameters

- `message` `TMessage`

### Explanation

With `blob` you can validate the data type of the input. If the input is not a blob, you can use `message` to customize the error message.

## Returns

- `Schema` `BlobSchema<TMessage>`

## Examples

The following examples show how `blob` can be used.

### Image schema

Schema to validate an image.

```ts
const ImageSchema = v.pipe(
  v.blob('Please select an image file.'),
  v.mimeType(['image/jpeg', 'image/png'], 'Please select a JPEG or PNG file.'),
  v.maxSize(1024 * 1024 * 10, 'Please select a file smaller than 10 MB.')
);
```

## Related

The following APIs can be combined with `blob`.

### Schemas

[`array`](/api/array.md), [`exactOptional`](/api/exactOptional.md), [`intersect`](/api/intersect.md), [`lazy`](/api/lazy.md), [`looseObject`](/api/looseObject.md), [`looseTuple`](/api/looseTuple.md), [`map`](/api/map.md), [`nonNullable`](/api/nonNullable.md), [`nonNullish`](/api/nonNullish.md), [`nonOptional`](/api/nonOptional.md), [`nullable`](/api/nullable.md), [`nullish`](/api/nullish.md), [`object`](/api/object.md), [`objectWithRest`](/api/objectWithRest.md), [`optional`](/api/optional.md), [`record`](/api/record.md), [`set`](/api/set.md), [`strictObject`](/api/strictObject.md), [`strictTuple`](/api/strictTuple.md), [`tuple`](/api/tuple.md), [`tupleWithRest`](/api/tupleWithRest.md), [`undefinedable`](/api/undefinedable.md), [`union`](/api/union.md)

### Methods

[`assert`](/api/assert.md), [`config`](/api/config.md), [`fallback`](/api/fallback.md), [`getDefault`](/api/getDefault.md), [`getDefaults`](/api/getDefaults.md), [`getFallback`](/api/getFallback.md), [`getFallbacks`](/api/getFallbacks.md), [`is`](/api/is.md), [`message`](/api/message.md), [`parse`](/api/parse.md), [`parser`](/api/parser.md), [`pipe`](/api/pipe.md), [`safeParse`](/api/safeParse.md), [`safeParser`](/api/safeParser.md)

### Actions

[`check`](/api/check.md), [`brand`](/api/brand.md), [`description`](/api/description.md), [`flavor`](/api/flavor.md), [`guard`](/api/guard.md), [`maxSize`](/api/maxSize.md), [`metadata`](/api/metadata.md), [`mimeType`](/api/mimeType.md), [`minSize`](/api/minSize.md), [`notSize`](/api/notSize.md), [`rawCheck`](/api/rawCheck.md), [`rawTransform`](/api/rawTransform.md), [`readonly`](/api/readonly.md), [`size`](/api/size.md), [`title`](/api/title.md), [`transform`](/api/transform.md)

### Utils

[`entriesFromList`](/api/entriesFromList.md), [`isOfKind`](/api/isOfKind.md), [`isOfType`](/api/isOfType.md)
