title: TypeError: Cannot read property 'then' of undefined at Object.Parse.File.save
body: <p>I use Sails Js for my project, and Parse.
  The thing which doesn't work is that I can not upload a file to Parse.
  There is a lot of same topic on the Internet, but always unsolved!</p>
  
  <p>Everything works until this point :</p>
  
  <pre><code>var newFile = new Parse.File(fileName, file, contentType);
  // fileName = blue.jpg, file = { JSON of all the file's information }, contentType = 'image/jpeg',
  // newFile = { _name: 'blue.jpg' }
  // so my HTML form works.
  
  // I tried (1)
  newFile.save().then(function() {
  // The file has been saved to Parse.
  }, function(error) {
  // The file either could not be read, or could not be saved to Parse.
  });
  
  // I tried (2)
  fs.readFile(filePath, function (err, data) {
      var newFile = new Parse.File('my_path_I_want...', data);
      newFile.save().then(function(file) {
      }, function(error) {
      });
  });
  </code></pre>
  
  <p>And the problem is always the same :</p>
  
  <pre><code>myApp/node_modules/parse/build/parse-latest.js:4438
  self._previousSave = self._source.then(function(base64, type) {
                                       ^
  TypeError: Cannot read property 'then' of undefined at Object.Parse.File.save      (myApp/node_modules/parse/build/parse-latest.js:4438:42)
  </code></pre>
  
  <p>I really don't know what to do/try now.</p>
  
  <p><a href="https://groups.google.com/forum/#!topic/parse-developers/F6t9HQYEBM8" rel="nofollow">Here</a> they say it's a bug, but I don't believe, no upload since 2014..</p>
  
  <p>And <a href="https://parse.com/docs/js/guide#files-creating-a-parse-file" rel="nofollow">here</a> is the Parse documentation section for Parse File.</p>
  
  <p>Have you got an idea ?</p>