Download .EXE file via JQuery

How can I do a function, that allow do the download of a file in C: ?

For example, when the link is clicked, trigger a javascript function that will open the file or made download.

I'm trying this,

But it execute the program, I need that execute a download!

   if (url == "Supremo") {
       var oShell = new ActiveXObject("WScript.Shell");
       var prog = "C:\\inetpub\\wwwroot\\admin.redenetimoveis.com\\San\\up\\arquivos\\Supremo.exe";               
       oShell.run('"' + prog + '"', 1);
       return false;
   }

Answers:

Answer

To get a user to download an exe file, you simply need to point them to the url with something like

window.location = 'http://admin.redenetimoveis.com/Supremo.exe';

As per the comment below, simply make an anchor tag that points to the file:

<a href="http://admin.redenetimoveis.com/Supremo.exe">Download Executable</a>
Answer

Create a hidden iframe with a src attribute pointing to the file that needs to be downloaded. Keep in mind, however, that the src value needs to be a file that is accessible to the client, such as going to a domain. http://www.somedomain.com/thefile.exe

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.