我有一个铁:路由器路由在用户尝试下载文件时声明:
// File Download Route
Router.route('/download/:file', function () {
// NodeJS request object
var request = this.request;
// NodeJS response object
var response = this.response;
this.response.end('file download content\n');
}, {where: 'server'}
);
如铁:路由器docs(http://eventedmind.github.io/iron-router/#server-routing)中所述。我传递给路径的文件是CollectionFS文件对象(https://github.com/CollectionFS/Meteor-CollectionFS)。我现在如何让应用程序实际触发文件下载。谢谢!