Reputation: 51
I am trying to crop and upload image with croppie plugin. The code is working fine on local server, but when I upload it on live server and upload an image, the POST URL shows 403 (Forbidden). I tried to search the solution online but could not find anything helpful. Can someone help me, the ajax request code is:
$('#cropImageBtn').on('click', function (ev) {
$uploadCrop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function (resimg) {
$.ajax({
url: "{{ route('profile.uploadimage') }}",
type: "POST",
data: {"image": resimg},
success: function (res) {
$('#item-img-output').attr('src', resimg);
$('#cropImagePop').modal('hide');
swal(
{
title: res.title,
text: res.text,
type: res.type,
allowOutsideClick: false
}).then(
function(){
location.reload();
}
);
}
});
});
});
Upvotes: 2
Views: 452