V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Tornado Documentation
http://www.v2ex.com/tornado/
Tornado on GitHub
https://github.com/facebook/tornado/
Tornado Gists
http://tornadogists.org/
paulguo
V2EX  ›  Tornado

Tornado中如何将一个download目录作为独立的目录,我现在把download放到static下边,结果打开download/xxxx.rar 不是下载而是直接打开文件内容了。

  •  
  •   paulguo · 2012-07-15 13:52:23 +08:00 · 4748 次点击
    这是一个创建于 4296 天前的主题,其中的信息可能已经有所发展或是发生改变。
    3 条回复    1970-01-01 08:00:00 +08:00
    southwolf
        1
    southwolf  
       2012-07-15 14:05:00 +08:00
    Google关键字 MIME type
    luztak
        2
    luztak  
       2012-07-15 14:15:51 +08:00
    tornado的HTTP Header的Content-Type默认是text/html……吧?所以当成html打开了.
    可以在浏览器下载东西的时候截包看看,Content-Type.
    whtsky
        3
    whtsky  
       2012-07-16 02:32:51 +08:00
    use StaticFileHandler.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1564 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:51 · PVG 00:51 · LAX 09:51 · JFK 12:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.