Skip to content

Commit 4d033da

Browse files
docs: update file-upload.md
Add a notion about the possibility to make the file presence optional
1 parent b4d0f62 commit 4d033da

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/techniques/file-upload.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ Finally, you can use the special `ParseFilePipeBuilder` class that lets you comp
155155
file: Express.Multer.File,
156156
```
157157

158+
> info **Hint** File presence is required by default, but you can make it optional by adding `fileIsRequired: false` parameter inside `build` function options (at the same level as `errorHttpStatusCode`).
159+
158160
#### Array of files
159161

160162
To upload an array of files (identified with a single field name), use the `FilesInterceptor()` decorator (note the plural **Files** in the decorator name). This decorator takes three arguments:

0 commit comments

Comments
 (0)