Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

342
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda