Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

345
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda