代码之家  ›  专栏  ›  技术社区  ›  Marc

如何在Windows Azure网站上提供.exe文件作为下载?

  •  1
  • Marc  · 技术社区  · 12 年前

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

    2 回复  |  直到 12 年前
        1
  •  5
  •   Gaurav Mantri    12 年前

    请尝试在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
  •  1
  •   Community Mohan Dere    10 年前

    将允许的mime类型添加到web配置中。如:

    <system.webServer>
        <staticContent>
          <mimeMap fileExtension=".exe" mimeType="application/exe"/>
        </staticContent>
    </system.webServer>
    
    推荐文章