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

249
Vistas
How to send File to Nodejs server to another api server without storing the file?

I am trying to send a pdf file to my node server and when my node server get the request it will send the same file to another api server. I am not suppose to store the file in my nodejs server. Just take the file and pass it to api server. here is my implementation below,

export const uploadDocument = async ctx => {
  try {
    const { path, name, type } = ctx.request.files.document;
    const file = path + name;
    await documentUpload(file);
  } catch (error) {
     console.log(error);
  }
};

const documentUpload = async file => {
  try {
    let formData = new FormData();
    formData.append("document", file);
    const response = await axios.post(
      `${variables.recruitUrl}/upload_url`,
      formData,
      {
  headers: {
    "Content-Type": "multipart/form-data",
    Authorization: `Bearer 5dd872b44a.d6d2e2950b3ae3a9f8081369cd82c953`,
  },
};
    );
    console.log(response);
  } catch (error) {
    console.log(error);
  }
};

the error I am getting from the api server is 'the request was rejected because no multipart boundary was found', If I remove the content type multipart to nothing api server return extra param found.

about 4 years ago · Juan Pablo Isaza
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