Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda