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
^4.6.0
Plugin version
No response
Node.js version
^16
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 22.04.1 LTS
Description
When we create route that accepts data as an multipart/form-data and when we don't pass file/binary in payload we are not able to access fields that is passed in body and also there is some kind of sequence like always we have to pass fields in first and last need to contain binary/file
Steps to Reproduce
create route that accepts multipart/form-data
try to access the form body with req.file()
now don't pass any file or binary just only pass fields which contains any type of data like ( string,int..etc )
then try to access that fields in req.file() / req.body anywhere it is not available
Expected Behavior
Should be able to access those fields in req.body although we don't pass any file or binary
The text was updated successfully, but these errors were encountered:
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.
After looking at this issue again. The behavior is expected since request.file will trigger the body stream to resume and start parsing.
You are required to use either request.parts() or attachFieldsToBody if you like automatic process.
Prerequisites
Fastify version
^4.6.0
Plugin version
No response
Node.js version
^16
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 22.04.1 LTS
Description
When we create route that accepts data as an multipart/form-data and when we don't pass file/binary in payload we are not able to access fields that is passed in body and also there is some kind of sequence like always we have to pass fields in first and last need to contain binary/file
Steps to Reproduce
Expected Behavior
Should be able to access those fields in req.body although we don't pass any file or binary
The text was updated successfully, but these errors were encountered: