You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.2.1
Plugin version
9.0.3
Node.js version
23.7.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Description
When using onFile, the part does not have typings for value
So this code from the readme is not valid. As such I am providing this github repo as the reproducible example:
asyncfunctiononFile(part){constbuff=awaitpart.toBuffer()constdecoded=Buffer.from(buff.toString(),'base64').toString()part.value=decoded// set `part.value` to specify the request body value}fastify.register(require('@fastify/multipart'),{attachFieldsToBody: 'keyValues', onFile })fastify.post('/upload/files',asyncfunction(req,reply){constuploadValue=req.body.upload// access file as base64 stringconstfooValue=req.body.foo// other fields})
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Fastify version
5.2.1
Plugin version
9.0.3
Node.js version
23.7.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Description
When using
onFile
, the part does not have typings forvalue
So this code from the readme is not valid. As such I am providing this github repo as the reproducible example:
Link to code that reproduces the bug
https://github.com/fastify/fastify-multipart
Expected Behavior
Typings for
value
onMultipartFile
The text was updated successfully, but these errors were encountered: