title: SyntaxError: Unexpected token - in JSON at position 0,While uploading pdf files in postman
body: <pre><code>Controller.js
  var multer = require('multer');
  
  var upload = (req, res) =&gt; {
      var storage = multer.diskStorage({
          destination: function (req, file, cb) {
              cb(null, './uploads/');
          },
          filename: function (req, file, cb) {
              var dateTimestamp = Date.now();
              cb(null, file.originalname.split('.')[file.originalname.split('.').length - 2] + '-' + dateTimestamp + '.' + file.originalname.split('.')[file.originalname.split('.').length - 1]);
          }
      });
      var upload = multer({
          storage: storage
      }).single('file');
      upload(req, res, function (err) {
          console.log(req.file);
          if(err) {
              res.json({ error_code: 1, err_desc: err });
              return;
          }
  res.json("File uploaded sucessfully");      
      });
  };
  
  module.exports ={
      upload:upload
  }
  
  app.js
  var mongoose = require("mongoose");
  var multipart = require('connect-multiparty');
  app.use(cors({origin:true, credentials:true}));
  app.use(bodyParser.json({limit: '50mb'}));
  app.use(bodyParser.urlencoded({limit: '50mb',extended: true}));
  app.use(multipart({}));
  
  mongoose.Promise = global.Promise;
  mongoose.connect("mongodb://127.0.0.1:27017/mydb");
  
  var UploadRouter =require('./upload/uploadRouter/upload-doc-router');
  
  app.use('/upload', UploadRouter);
  
  
  var PORT = process.env.PORT || 4000;
  app.listen(PORT, function(){
      console.log('Running on Port 4000...');
  
  });
  
  router:
  var express =require("express");
  var URouter = express.Router();
  
  var Upload = require('../uploadControllers/upload-doc-controllers');
  
  URouter.route('/single/file').post(Upload.upload);
  
  module.exports =URouter;
  </code></pre>
  
  <p>Above are the my code.I want to upload pdf,word document and store in one folder.when i test the api getting syntax error Unexpected token - in JSON at position 0 , JSON.parse (&lt;anonymous&gt;), createStrictSyntaxError like that shows error in postman .when i choose file in pdf then send the request to the api.</p>