title: How to implement a file download in MeanJS application
body: <p>Im a mobile app developer and new to web apps. Im trying to implement upload and download a file in the web app using MeanJS stack. I have used multer plugin to upload file to server. After a lot of googling I have successfully used Multer which uploads and saves the files to uploads directory. 
  Now Im trying to implement download the same, and I don't have an idea to do this. I have followed two methods:</p>
  
  <ol>
  <li><code>&lt;a target="_self" href="/uploads/{{eachDocument.modifiedFileName}}" download="{{eachDocument.fileName}}"&gt;{{eachDocument.fileName}}&lt;/a&gt;</code></li>
  <li>Have used a route in the express server controller, as given in <a href="http://expressjs.com/api.html#res.download" rel="nofollow">http://expressjs.com/api.html#res.download</a></li>
  </ol>
  
  <p>Using the method #1 application never downloads the file with an error "Not a file", because uploads is not the public directory.</p>
  
  <p>Using method #2, I'm able to get the raw file content, but not sure how to save the file.</p>
  
  <p>Can anyone please tell me how to implement the file download that are saved in uploads directory that were uploaded using multer.</p>
  
  <p>Thanks</p>