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

187
Visualizações
Replacement for ActiveXObject("Scripting.FileSystemObject");

Refactoring old javascript code, what is an effective replacement for the below ActiveX code? Just having the ability to write a local file.

function WriteToFile(bufObj, fileName) {
 var fileObj;
 fileObj = new ActiveXObject("Scripting.FileSystemObject");
 fileObj = fileObj.OpenTextFile(fileName, ForWriting, true, TristateMixed);
 fileObj.Write(bufObj);
 fileObj.Close();
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You don't have that ability in a modern browser. (unless someone is crazy enough to still allow ActiveX controls - which no one does anymore).

the local file system is 100% HANDS off!!!

If you allow this?

Then when you come to my site to look at a cute cat picture? Then I am going to rummage around - and up-load say a text file called "my passwords". Or how about I go rummage around and look for a file called my banking?

or grab all your emails?

In fact, your JavaScript cannot even SELECT or set a file when using the file-up-load. So, any kind of local file access is not allowed, and is out of the question.

If this was to be allowed, then no one would ever use nor trust the internet again!

It is a security hole far to large. Now perhaps this might be some internal "only" web site, and some kind of local file rights and access is to be allowed? That being the case? You have to continue to allow and setup the browser to allow ActiveX for that internal site - but this is a high risk adventure.

So, you don't have a replacement, since browsers are locked down from code even touching, knowing or having ANY knowledge of the client side folders. Beside, the user might be on their Android phone, or a iPad - and they have rather different file systems anyway (and they don't have support for ActiveX either).

So, modern browsers have ZERO ability, I repeat ZERO ability to see, touch, know about the existence of ANY local file - it simple not allowed. About the only way around this issue would be to find a browser that still supports and allows ActiveX - and they are far and few between these days.

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