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

450
Views
How to append a specific file to FormData with Javascript?

I need to append a specific file to my FormData object using JavaScript.

var form = new FormData();
form.append("input", '{ ... some json ... }');
form.append("files", "/C:/My/Path/File.txt");

I dont want to select the file through a input button.

All examples that i founded do this:

var form = new FormData();
form.append("input", '{ ... some json ... }');
form.append("files", input.Files[0], "/C:/My/Path/File.txt");
        

So i think that i have to load that file into a blob or file object. But i dont get it.

Hoy can i do it? Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Acoording to @Andy comment and to this post https://stackoverflow.com/a/3014623/8037813, effectively it is not possible to do this by security issues.

Dont lose your time trying to do it.

Thanks.

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