---
lang: en
title: 'API docs: openapi-v3.requestbody.file'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/openapi-v3
permalink: /doc/en/lb4/apidocs.openapi-v3.requestbody.file.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/openapi-v3](./openapi-v3.md) &gt; [requestBody](./openapi-v3.requestbody.md) &gt; [file](./openapi-v3.requestbody.file.md)

## requestBody.file variable

Define a requestBody of `file` type. This is used to support multipart/form-data based file upload. Use `@requestBody` for other content types.

[OpenAPI file upload](https://swagger.io/docs/specification/describing-request-body/file-upload)

<b>Signature:</b>

```typescript
file: (properties?: {
        description?: string | undefined;
        required?: boolean | undefined;
    } | undefined) => (target: object, member: string, index: number) => void
```

## Example

import {<!-- -->Request<!-- -->} from '<!-- -->@<!-- -->loopback/rest';

```ts
class MyController {
  @post('/pictures')
  upload(
    @requestBody.file()
    request: Request,
  ) {
    // ...
  }
}

```


