coolicer
V2EX  ›  Node.js

Angluar+Express,Express 做下载没反应。

  •  
  •   coolicer · Mar 29, 2014 · 3476 views
    This topic created in 4433 days ago, the information mentioned may be changed or developed.
    我做了一个简单的测试,通过 localhost:8080/Excel 可以下载。

    app.get('/', function(req,res){
    ___res.send('hello');
    })

    app.get('/Excel', function(req,res){
    ___res.download(__dirname + '/123.txt');
    })


    上一次问了一个问题,就是要在某个页面导出Excel。因为angualr路由的问题,我后来通过$http发起一次请求,才能在express中获取到路由。但是res.download没有反应。

    没有思路了...各位
    2 replies    1970-01-01 08:00:00 +08:00
    jinwyp
        1
    jinwyp  
       Apr 3, 2014
    没看懂问题,下载excel文件直接用后端路由,和angular路由根本没关系啊
    coolicer
        2
    coolicer  
    OP
       Apr 5, 2014
    @jinwyp 我已经解决了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5017 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 09:33 · PVG 17:33 · LAX 02:33 · JFK 05:33
    ♥ Do have faith in what you're doing.