【问题标题】:How to provide an .exe file as download on Windows Azure Website?如何在 Windows Azure 网站上提供 .exe 文件作为下载文件?
【发布时间】:2016-08-30 04:48:43
【问题描述】:

我正在尝试将 ClickOnce 安装程序发布到托管在 Windows Azure 上的网站上。发布过程按预期工作,但安装文件无法通过 HTTP 下载。显然不可能通过 HTTP 提供可执行文件 (.exe) 和库 (.dll)。它们可通过 FTP 获得,但 HTTP 请求会产生“找不到文件”(404)。将文件重命名为 setup.txt 后,可以下载它,但这并没有真正的帮助。这可以以某种方式配置吗?

【问题讨论】:

    标签: azure clickonce


    【解决方案1】:

    请尝试在您的 web.config 文件中添加以下内容:

    <system.webServer>
        <handlers>
          <add name="Client exe" path="*.exe" verb="*" modules="StaticFileModule" resourceType="File" />
        </handlers>
    </system.webServer>
    

    来源:http://mike-ward.net/blog/post/00631/how-to-configure-iis-7-to-allow-downloading-exe-files

    【讨论】:

      【解决方案2】:

      将允许的 mime 类型添加到 web config。例如:

      <system.webServer>
          <staticContent>
            <mimeMap fileExtension=".exe" mimeType="application/exe"/>
          </staticContent>
      </system.webServer>
      

      【讨论】:

        猜你喜欢
        • 2023-01-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-16
        相关资源
        最近更新 更多