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

243
Views
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
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!