How to handle multipart/form-data #1716
Answered
by
Romakita
rizchaerul
asked this question in
Q&A
-
Hi, I read the docs about multipart/form-data (https://tsed.io/api/platform/common/types/decorators/multer/MultipartFile.html) But it seems that it only support file field? Is it possible if I declare it like this? If not then what would you recommend to get all the field + files from multipart/form-data. Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
Romakita
Jan 4, 2022
Replies: 1 comment 1 reply
-
Hello @rizchaerul You have to use the get(@MultipartFile('file') file: any, @BodyParams() form: AppForm) See you |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rizchaerul
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @rizchaerul
You have to use the
@MultipartFile
to get the file. @BodyParams isn't designed for that. But you can use BodyParams decorator to get extra fields.See you
Romain