title: Trying to download a file with express from the server as client -> Unexpected token �
body: <p>currently I am always running in the same <a href="https://i.gyazo.com/552eb36def1eb7fab9ea12f0f181ff9e.png" rel="nofollow noreferrer">error</a> and I do not find any solution. I am trying to download a file from the server as a client with express.
  This is the code serverside:</p>
  
  <pre><code>// Set up
  var nodemailer = require('nodemailer');
  var express = require('express');
  var multer = require('multer');
  var app = express();                               
  var mongoose = require('mongoose');                     
  var morgan = require('morgan');             
  var bodyParser = require('body-parser');    
  var methodOverride = require('method-override'); 
  var cors = require('cors');
  
  var fs = require('fs');
  var path = require('path');
  var mkdirp = require('mkdirp');
  
  mongoose.connect('mongodb://localhost:27017/Sharify');
  
  app.use(morgan('dev'));                                         
  app.use(bodyParser.urlencoded({ 'extended': 'true' }));            
  app.use(bodyParser.json());                                     
  app.use(bodyParser.json({ type: 'application/vnd.api+json' })); 
  app.use(methodOverride());
  app.use(cors());
  
  app.use(function (req, res, next) {
      res.header("Access-Control-Allow-Origin", "*");
      res.header('Access-Control-Allow-Methods', 'DELETE, PUT, GET');
      res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
      next();
  });
  
  app.get('/api/download/:projectid/:filename', function (req, res) {
      res.download(__dirname + '/uploads/' + req.params.projectid + '/' + req.params.filename);    
  });
  </code></pre>
  
  <p>Clientside it is getting called by this:</p>
  
  <pre><code>downloadFile(file)
  {
    return new Promise(resolve =&gt; {
         this.http.get('http://localhost:27017/api/download/' + file.projectID + "/" + file.fileName)
             .map(res =&gt; res.json())
             .subscribe(data =&gt; {
                 resolve(this.data);
             });
     });        
  }
  </code></pre>
  
  <p>I always get this error in the developer console: <a href="https://gyazo.com/552eb36def1eb7fab9ea12f0f181ff9e" rel="nofollow noreferrer">https://gyazo.com/552eb36def1eb7fab9ea12f0f181ff9e</a>
  Does someone know a solution for that? Thanks in advance!</p>