将 IIS 设置为执行 EXE 而不是下载



我正在使用EXE文件作为内部网站的后端。 我有服务器 2019 和 IIS 10。 当我调用 EXE 文件时,IIS 会尝试下载该文件而不是执行它。

我这样打电话:

$.ajax({    
url: "cgi-bin/compPack.exe",    
dataType: "json",
type: "post",       
data: dataString,
error: ajaxError,           
success: function(json){   

这给出了一个错误,因为它需要一个 JSON 字符串,如果我输入

sandbox/cgi-bin/myProgram.exe

在浏览器中,它只是下载 EXE。

我已经添加了 CGI 模块,在 CGI-BIN 文件夹上设置了权限,尝试从 Mime 类型中添加和删除.exe作为应用程序/八位字节流,但无法让它运行二进制文件。

我不确定我需要做什么才能让它在 cgi-bin 文件夹中执行(任何(EXE 文件。

解决方法是应用 IBM 在此处演示的设置。他们的Watson Explorer引擎也使用EXE作为CGI后端。

IIS 7.0 and higher on Windows 2008 and later systems:
Open IIS Manager:
For Windows 2008 systems: Select Control Panel > Administrative Tools > Internet Information Services (IIS) Manager.
For Windows 2012 systems: From the desktop, hover your cursor in the upper- or lower- right corner of the screen to show the charms. Click the Start charm, and then click the Internet Information Services (IIS) Manager tile.
In the Connections pane, expand the entry for your computer system, expand Sites, and select the default site, which is the site in which the Watson Explorer Engine virtual directory (vivisimo) is created.
Double-click the Handler Mappings feature.
If the state of CGI-exe is Enabled, no additional configuration is necessary. Proceed to Completing the Installation Process (All Platforms).
If the state of CGI-exe is Disabled, select it and click Edit Feature Permissions from the Actions pane. The Edit Feature Permissions window displays.
Select Execute and click OK to enable applications with the .exe extension to execute in response to CGI requests. If Execute is disabled, select Script > Execute, and then click OK.

最新更新