title: How to upload and download a file in a single service call in nodejs?
body: <p>I can upload a file via postman and download a file from server in two different service .. But what i need is ..In a single call i should able to upload the file to server ,then perform some operation after performing some operation i should able to download the file automatically.
  Here is my code.</p>
  
  <p>My firsts service(file upload operation)</p>
  
  <pre><code>  var express = require('express');
    var fs = require('fs');
    var formidable = require('formidable');
    var router = express.Router();
    /* GET home page. */
    router.post('/', function(req, res, next) {
  
    var form = new formidable.IncomingForm();
    form.uploadDir="./file"
    form.keepExtensions=true;
    form.maxFileSize=10*1024*1024;
    form.multiples=false;
    form.parse(req, function (err, fields, files) {
    res.write('File uploaded');
    res.end();
    });
    });
    module.exports = router;  
  </code></pre>
  
  <p>Download service</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var express = require('express');
  
  
  router.get('/', function(req, res, next) {
      var file = './file/myOutput.txt';
        var name = 'ENC.txt'
        res.download(file, name);
  });
  
  module.exports = router;
  </code></pre>
  
  <p>Now i need to make this two service as one?</p>