Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion examples/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down