Cannot upload file for PUT or PATCH method #2611
Unanswered
Mistermasque
asked this question in
Q&A
Replies: 2 comments
-
@Mistermasque , you also need to modify createConfig({
inputSources: {
put: ["body", "params", "files"],
patch: ["body", "params", "files"],
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hoooww. I see, I clearly missed this config options. It works fine now :-) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I cannot upload a file for PUT or PATCH method endpoint. The file is correctly sent but arrive undefined in input.
Expected
Uploaded file has to be filled in input params in handler endpoint function.
Reproduction
I'm using last code revision on branch master.
I modify
upload-avatar.ts
inexample/endpoints
to change method from post to put.I build application and launch it :
Send a curl command :
Response :
I see that file is correctly uploaded by express-file-upload according to this logs :
But with no modification (let method post to upload-avatar endpoint), I expect this response :
Context
express-zod-api
version: 23.1.2Beta Was this translation helpful? Give feedback.
All reactions