Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

340
Views
How to get image file with other parameters in node.js using typescript?

I am getting an image file and other parameters in a single form. I am using routing-controller (npm library) decorator to get the file @UploadedFile("image") file?: any and getting other params in body @Body({ required: true }) review: ReviewInput. Is there any good way to get these params? ReviewInput is my defined type which contains the string params following is the code where I am getting params:

@Post("/review")
async addReview(
@Body({ required: true }) review: ReviewInput,
@UploadedFile("image") file?: any,) {

return AddReviewsUsecase.execute(review, file);

}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can use @BodyParam() if you have few parameters in body. Example:

@Post("/review")
async addReview(
    @BodyParam() review: string,
    @BodyParam() rating: number,
    @UploadedFile("image") file?: any,
) {
    return AddReviewsUsecase.execute(review, file);
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!