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

255
Views
how to pass a variable from html to node.js

so I have this app that reads a file uploaded from the client (index.html) I want to get the file that was uploaded on html and user it on my app.js to read it. How do I do that. Here goes the files bellow:

index.html

 <input type="file" id="myFile" name="filename">
 <input type="submit">

app.js

 var fs = require('fs');
 var readMe = fs.readFileSync(??? , 'utf8');
 console.log(readMe);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This should return you the full path of the selected file:

var readMe = fs.readFileSync(document.getElementById("myFile").value , 'utf8');
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!