From 366e0aad0e8dcf09c06655d7d2b8bdb0a9a8dc21 Mon Sep 17 00:00:00 2001 From: starptech Date: Wed, 26 Aug 2020 13:58:38 +0200 Subject: [PATCH] fix docs examples --- README.md | 4 ++-- examples/example.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f2c8d495..4501d3fe 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ try { } ``` -Additionally, you can pass per-request options to the req.multipart function +Additionally, you can pass per-request options to the `req.file`, `req.files`, `req.saveRequestFiles` or `req.multipartIterator` function. ```js fastify.post('/', async function (req, reply) { @@ -130,7 +130,7 @@ fastify.post('/', async function (req, reply) { ```js fastify.post('/upload/raw/any', async function (req, reply) { - const parts = await req.multipart() + const parts = await req.multipartIterator() for await (const part of parts) { if (part.file) { await pump(part.file, fs.createWriteStream(part.filename)) diff --git a/examples/example.js b/examples/example.js index 31fe1cc4..63309f25 100644 --- a/examples/example.js +++ b/examples/example.js @@ -29,7 +29,7 @@ fastify.post('/upload/stream/files', async function (req, reply) { }) fastify.post('/upload/raw/any', async function (req, reply) { - const parts = await req.multipart() + const parts = await req.multipartIterator() for await (const part of parts) { if (part.file) { await pump(part.file, fs.createWriteStream(part.filename))