I have this code for image uploading:
$scope.uploadAvatar = function(e) {
    $scope.uploadAvatarError = false;
    $scope.uploadAvatarSuccess = false;
    var f = document.getElementById('uploadAvatar').files[0],
        fd = new FormData();
    if (!f) {
        return
    }
    fd.append('user', $scope.user.user_email);
    fd.append('photo', f);
    $http.post(apiUrl + 'addProfilePicture', fd, {
        transformRequest: angular.identity,
        headers: {'Content-Type': undefined}
    }).then(function(response){
        console.log(response);
    })
}
When I send it to server, it returns status 200, but nothing is uploaded. In network tab in chrome dev tools it says ContentType application/json instead of multipart/form-data. How can I change that?
 
    