title: How to perform Insert statement by decoding Base64 in express
body: <p>How to decode the param values received which were received as Base64 encoded form and insert into database ?</p>
  
  <p>This is what i have tried. </p>
  
  <ul>
  <li>According to this i am getting one value recieved from the client as
  param value and inserting into server ( I have recieved the request
  at POST )</li>
  <li>No <code>base64</code> encoding is done here</li>
  </ul>
  
  <p>I am using this code at present :</p>
  
  <pre><code>var express = require('express')
   , async = require('async')
   , http = require('http')
   , mysql = require('mysql');
  
  var app = express();
  
  var connection = mysql.createConnection({
     host: 'localhost',
     user: '******',
     password: "******",
     database: 'posting_information_DB'
  });
  
  connection.connect();
  
  // all environments
  app.set('port', process.env.PORT || 1234);
  
  app.use(express.static(__dirname + '/public/images'));
  
  
  app.post('/Name/',function(request,response,next){
  
  
  app.use(express.bodyParser());
  
     var keyName=request.query.Key;
     var name_of_restaurants;
     async.series( [
  
         function(callback) {
  
            connection.query('INSERT INTO details (name) VALUES (?)', [keyName], function (err, rows, fields) 
                {
                        console.log('Connection result error ' + err);        
                        callback();
                });
         }
  
    // Send the response
  ] );
  } );
  
  
  http.createServer(app).listen(app.get('port'), function(){
   console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>
  
  <p>What i am trying to do !</p>
  
  <ul>
  <li>Now what changes should i need to make so that when i need recieve a
  <code>image</code> and <code>string</code> as two param values</li>
  <li>These values are Base64 encoded</li>
  <li>How to decode these Base64 here and then insert the retrieved param
  values to database</li>
  </ul>
  
  <p>How to modify my posted Express code !</p>
  
  <p>Thanks !</p>