I have asked various questions and got only limited answers and it has gotten me this far: Mongoose code :
app.get('/Download/:file(*)', function (req, res) {
grid.mongo = mongoose.mongo;
var gfs = grid(conn.db);
var file = req.params.file
var fs_write_stream = fs.createWriteStream('Program.cs');
var readstream = gfs.createReadStream({ filename: file });
readstream.pipe(fs_write_stream);
res.download(__dirname+'/Program.cs', 'Solution.cs', function (err) {
if (err) throw err;
else console.log("check console");
});
})
Angular code:
$scope.Download = function () {
$http.get(url + "/Download/"+"Program.cs")
.success(function (res) {
console.log(res);
})}
When I open my console angular just returns a blank line, when i look into the network aspect the header sais this:
I want to be able to store this file to my local file system to a path that I want to be able to choose myself. PLEASE help me out, I'm desperate, I have looked EVERYwhere for a solution, thank you very much in advance!