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

226
Views
Check with JavaScript if server side log file has been modified?

In the same directory on the server as the html page I have a log that comes from an application. I want to check this file exists and the size or modified date of this file.

This needs to be in a simple JavaScript function that looks for the file and confirms it exists and the size or time modified of the file.

This is so I can update or reload my html page if there is new data. The data itself is being transformed via xslt. Is there something like this I can do:

function checkForLog() {
  let logFile = new File([""],"./report.log");
  let size = logFile.size;

  if (size > previousSize){
    location.reload(true);
  }    
}

I tried this but it returns 0 even though the file report.log is 56kb so it seems this logFile is a new file instance and not actually a reference to my file in the directory.

about 4 years ago · Santiago Trujillo
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!