---
title: "parseMultipartRequest"
source: "https://github.com/remix-run/remix/blob/8905f3943706e1f53696ab83e70a84873cabfc90/packages/multipart-parser/src/lib/future/multipart-request.ts#L21"
---

# parseMultipartRequest

## Summary

Parse a multipart [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and
yield each part as a [`MultipartPart`](/multipart-parser/future/class/MultipartPart/) as soon as its headers arrive. Part content is
streamed from the request body as you read it, so large uploads are never buffered in memory.

Read each part's content before continuing to the next part. When you continue, the parser
waits for a read you started to finish and discards any content you didn't read.

## Signature

```ts
function parseMultipartRequest(
  request: Request,
  options: MultipartParserOptions,
): AsyncGenerator<MultipartPart, void, unknown>

```

## Parameters

### `request`

The `Request` object containing multipart data

### `options`

Optional parser options, such as `maxHeaderSize`, `maxFileSize`, `maxParts`,
and `maxTotalSize`

## Returns

An async generator yielding [`MultipartPart`](/multipart-parser/future/class/MultipartPart/) objects