使用Meteor和Iron路由器导出CSV文件 - 客户端丢失收集信息

时间:2014-08-05 13:15:41

标签: meteor export-to-csv iron-router

我正尝试使用此代码在服务器端使用Iron-Router从Meteor导出CSV文件:

this.route('export_cand', { // Export Candidates
path: '/export/cand/:_id',
    where: 'server',
    action: function() {
        headers={
            'Content-type': 'text/csv',
    'Content-Disposition': "attachment; filename=candidates.csv"
        };
        this.response.writeHead(200, headers);
        strFile='contents of the CSV file';
        this.response.end(strFile);
    }
})

文件已成功生成,但网页会丢失所有收集信息。有什么想法发生了什么?

0 个答案:

没有答案