I have following code in VF page:
<tr>
<td class = "jtd">Resume</td>
<td><input type="file" id="file" ng-model="con.file"/>
</td>
</tr>
I have a button called 'Register', Onclick of this button, I want to save an attachment with contact(ParentId).
Here is my Angular Code:
var App = angular.module('myApp', []);
App.controller('myctrl', function ($scope, appFactory ) {
$scope.jDetails = '{!objJobDetail}';
console.log($scope.jDetails);
$scope.saveData = function(con) {
$scope.message = appFactory.saveContact(con);
$scope.$apply();
}
});
App.factory('appFactory', function(){
return {
saveContact: function(con) {
var reply ="";
var jsonContact = JSON.stringify(con);
console.log(con);
//var jsonAccount = JSON.stringify(Account);
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.ApplyToJobController.addContacts}',
jsonContact,
function(result, event) {
if (event.status){
reply = "Factory Saved Data";
//window.location.reload();
}else
{
reply = "Failed";
//window.location.reload();
}
});
return reply;
}
};
});
The thing is, I'm able to create contact/Send Contact data to Apex Method, But Don't see any attachment data. The console.log() is also not showing up any file data.