V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Eysa
V2EX  ›  问与答

如何使 iis 能在浏览器里敲个 url 后下载 exe 文件呢。?

  •  
  •   Eysa · 2012-02-21 14:30:52 +08:00 · 4571 次点击
    这是一个创建于 4441 天前的主题,其中的信息可能已经有所发展或是发生改变。
    4 条回复    1970-01-01 08:00:00 +08:00
    ayanamist
        1
    ayanamist  
       2012-02-21 17:54:45 +08:00
    给exe文件指定一个MIME
    Eysa
        2
    Eysa  
    OP
       2012-02-21 20:09:41 +08:00
    @ayanamist
    貌似这样并不能再浏览器敲个url弹个下载框吧?
    Platinum
        3
    Platinum  
       2012-02-21 20:14:00 +08:00
    Content-type: application/octet-stream
    bitsmix
        4
    bitsmix  
       2012-02-21 20:51:15 +08:00
    'Content-Disposition':'attachment; filename=[your file name]'

    http response head 里面加上上面这个。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1025 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:15 · PVG 03:15 · LAX 12:15 · JFK 15:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.