Hello,
I’ve created a server side route like this:
Router.route('/downloadpcslist/:taskId', function() {
var task = Task.findOne({_id: this.params.taskId});
if(task) {
var doc = new PDFDocument({size: "a4", margin: 8});
createPDFDocument(doc, task);
var filename = task.task_nostring + "_stueckliste";
this.response.writeHead(200, {
'Content-type': 'application/pdf',
'Content-Disposition': "attachment; filename="+filename+".pdf"
});
this.response.end(doc.outputSync());
}
}, {where: 'server'});
and I am calling this route via Router.go("/downloadpcslist/" + taskid) from my event.
It works well and I can download the pdf file, but if I try it to download the file again it doesn’t work, it feels like my application crashes, because if try to execute any events on my site it also doesn’t work. I can only download the file again if I reload the page.
I am at loss.
Thanks for help.