通过JQuery下载.EXE文件 [英] Download .EXE file via JQuery

查看:57
本文介绍了通过JQuery下载.EXE文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何执行允许在C中下载文件的功能:?

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

例如,单击链接时,触发javascript函数这将打开文件或下载。

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

我正在尝试这个,

但它执行程序,我需要执行下载!

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;
   }


推荐答案

让用户下载一个exe文件,你只需要将它们指向网址,例如

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>

这篇关于通过JQuery下载.EXE文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆