I'm creating in a system that I'm developing for our client, a function where it allows the same to upload the logo and cut it, then when it's saved I'm trying to load the image that was uploaded, but it happens I need it to always be the same name and in the same destination and the browser can not update it, for example:
Current image name = logo.png;
After uploading the image name continues logo.png but with another image saved, because if I reload the page the logo is applied as it should, I would like to know if there is any way to do this without reloading the page, follow the code which I use to set the image:
$scope.carregarLogo = function(name){
if($scope.img_name=== '' && angular.isUndefined(name) || name === ''){
$scope.img_name = url_sistema + 'web_files/img/logo.png';
$('#img').attr('src',$scope.img_name);
console.log('deu');
}else{
$scope.img_name = name;
$('#img').attr('src',$scope.img_name);
console.log($('#img').attr('src'));
console.log('deu2');
}
};