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

208
Views
How can I allow all setRequestHeader in Ajax?

I am developing an application where I would like to allow my setRequestHeader to accept all file types. I'm trying to send via POST two input values, one of the text type and the other of the file type, but I'm only allowing one of the two.

my code:

 var xml = new XMLHttpRequest();
 xml.open("POST", url, true);
 xml.setRequestHeader('Accept', 'multipart/form-data');
 //xml.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded');
 xml.onloadend = response;
 xml.send(send);

How can I set the setRequestHeader to allow all file types or at least the ones I need which is text and file type, is there a specific setRequestHeader for that?

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!