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

379
Visualizações
Migrating to Edge Browser - file upload not working

We are migrating from IE 8 to Edge browser,

Below is the code working in IE 8, to load one file, but not in Edge.

if(window.ActiveXObject){
                var fso = new ActiveXObject("Scripting.FileSystemObject");
                var filepath = document.getElementById('filePath').value;
                var thefile = fso.getFile(filepath);

Could you please let me know equivalent code for edge browser.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Edge doesn't support ActiveX. You can use File API <input type="file"> to choose files and then use XMLHttpRequest to upload files in modern browsers.

For more information you can refer to this thread and this code sample.

about 4 years ago · Juan Pablo Isaza Relatório

0

A lot has changed since the code you are trying to upgrade was created. Local Storage now exists and to download a file; (Use case somebody may need to save it for using it locally) a download attrib is added to the anchor html tag. The file needs to be made into a URL-Blob

<a id="download" download="example.png">
<button type="button" onClick="download()" class="UI">Download</button>
</a>
<script>
function download() {
   var download = document.getElementById("download");
   var image = document.getElementById("meme").toDataURL("image/png").replace("image/png", "image/octet-stream");
   download.setAttribute("href", image);
}
</script>

I would migrate to local-storage or IndexedDB API.

There is no drop in replacement for the activeX. because of security issues.

Major Differences

ActiveX allowed javascript to access a file to read or write, including being able to overwrite itself, anywhere on the hard drive.

HTML5 Allows reading and writting to localdata and several API for data including IndexDB. But file access is limited to what the user specifically uploads or for downloading into the download directory.

A Javascript WIKI page that replaces itself is no longer possible if you want it to overwrite itself. A Javascript WIKI page is possible using the IndexDB. Downloading the content is possible but limited for security reasons.

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