Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new AV.File(file.name, file).save().then(savedFile => $scope.send(new ImageMessage(savedFile)))
)).catch(console.error);