title: ParseFile : Cannot read property 'then' of undefined
body: <pre><code>  router.post('/uploadImage',function(req,res){
    console.log("Upload image called");
    var dcod=req.body.myPhoto;
    console.log("File : "+req.body.myPhoto+"\n"+dcod);
  
    var file = {base64:dcod};
    var decodedFile = new Buffer(file, 'base64');
    var name ="a.jpg";
  
    var parseFile = new Parse.File(name,decodedFile,"image/jpg");
      parseFile.save().then(function() 
             {
                console.log("inside save");
                Parse.Cloud.useMasterKey();
                var query = new Parse.Query(Parse.User);
                query.equalTo("objectId","S8qZJM7XIA");
                query.find({
                  success: function(results) 
                  {
                   results.set("profileImg",parseFile);
                   results.save(null, {
                     success: function(results) {
                     params.success(Response.UpdateSuccess);
                     },
                     error: function(gameScore, error) {
                         console.log('Failed to create new object, with error code: ' + error.description);
                         }
                     });
                  }
                })
             }, 
             function(error) 
             {
               console.log("error  :"+error.message);
             }
      );
  });
  </code></pre>
  
  <p>I am getting an error while saving the image to my Object in Parse Cloud.</p>
  
  <p>In <code>parseFile.save()then(.....)</code></p>
  
  <p>throws error at runtime.
  I.e., </p>
  
  <blockquote>
    <p>Cannot read property 'then' of undefined</p>
  </blockquote>