lib/cloud/services/fileService.js
function parseBase64Stream(req) {
  var passthrough = false;
  var accumulation = '';
  var stream = req.pipe(through(function(chunk, enc, callback) {
    if (!passthrough) {
      accumulation += chunk;
      var test = ';base64,';
      var index = accumulation.indexOf(test);
      if (index > -1) {
        passthrough = true;
        chunk = accumulation.substr(index + test.length);
      }
    }
    if (passthrough) {
      this.push(chunk);
    }
    callback();
  }))
    .pipe(base64.decode());
  return stream;
}
function parseBase64Stream(req) {
  var passthrough = false;
  var accumulation = '';
  var stream = req.pipe(through(function(chunk, enc, callback) {
    if (!passthrough) {
      accumulation += chunk;
      var test = ';base64,';
      var index = accumulation.indexOf(test);
      if (index > -1) {
        passthrough = true;
        chunk = accumulation.substr(index + test.length);
      }
    }
    if (passthrough) {
      this.push(chunk);
    }
    callback();
  }))
    .pipe(base64.decode());
  return stream;
}
function parseBase64Stream ( req ) { var passthrough = false ; var accumulation = '' ; var stream = req . pipe ( through ( function ( chunk , enc , callback ) { if ( ! passthrough ) { accumulation += chunk ; var test = ';base64,' ; var index = accumulation . indexOf ( test ) ; if ( index > - 1 ) { passthrough = true ; chunk = accumulation . substr ( index + test . length ) ; } } if ( passthrough ) { this . push ( chunk ) ; } callback ( ) ; } ) ) . pipe ( base64 . decode ( ) ) ; return stream ; }
Parse Base64 URL into stream that can be saved as file.

@param req
Parse Base64 URL into stream that can be saved as file .