Open Ryooshuu opened 11 months ago
Would you like to send a PR?
If you want the name of the file, you should be using attachFieldsToBody: true
We could make a PR where we pass file fields directly to the body
I'm using attachFieldsToBody: "keyValues"
explicitly to keep the body
properties returning only the value given to it during the request. Though, I suppose internally I could make it possible to use attachFieldsToBody: true
and make a function that returns the value of that property.
Thank you for the PR, however, I'll be looking forward to it being merged.
Prerequisites
Fastify version
4.21.0
Plugin version
7.7.3
Node.js version
20.3.1
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10.0.19044 Build 19044
Description
I'm not entirely sure if this is an intentional change, but it's certainly one that I don't personally agree with. As far as I'm aware and have explored, there is no possible way to get the name of the file as
request.body.(field where the file should be)
provides only the buffer and nothing else.Steps to Reproduce
Expected Behavior
Instead of returning
no file
, it should return the data of the sent file without requiring the usage ofrequest.body.(field where the file should be)
.