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

438
Visualizações
Web application - Write To .txt file with Javascript FileObject.Write

I'm trying to re-purpose some older java script code that I use in order to create a text file via an intranet web app. The following code creates text files that are picked up and processed by a third party application running on the same device...

<script>
    function WriteTransferFile(location) {
        var fileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
        var fileObject = fileSystemObject.CreateTextFile("C:\\transfer\\transfer.txt", true);
        fileObject.Write(location);
        fileObject.Close();
        return location;
    }
</script>

<script id="writetransfer">
    function writetransfer() {
        var Location = document.getElementById('lblCommand');
        var Command = Location.innerHTML;
        WriteTransferFile(Command);
        }
</script>

This works fine for a single text string to be pasted into a text file, but I now need to create a file which takes 4 different fields from the web page and writes them on to consecutive lines. I've played around with the above but any attempt to add a second line of text overwrites the first line instead creating a new one below it. Desired output...

Field 1

Field 2

Field 3

Field 4

Any ideas how I might accomplish this?

I'm aware this probably isn't the sleekest solution, but there are no concerns regarding the suppression of active X security settings as this is for a closed system with access to local intranet only.

Thanks

Steve

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