MethodNotAllowedHttpException shouldn't be thrown because of the post_max_size. Are you sure your form has right type of HTTP request ?
MethodNotAllowedHttpException come when i am trying to upload 15Mb file
MethodNotAllowedHttpException is come when i am trying to upload 15 Mb file. i changed post_max_size and other configuration on the php.ini file
@nikos yes i putted in ajax as method: "POST"
And are you sending csrf token ?
@nikos yes i am sending csrf token
@nikos i am this is my js code
``$("#add-property-button").click(function (e) { e.preventDefault();
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('#_token').val()
}
});
console.log( $('input[type=file]')[0].files);
var formdata = new FormData();
var files =$('input[type=file]')[0].files;
for(var i=0;i<files.length;i++){
formdata.append("images[]", files[i], files[i]['name']);
}
formdata.append("property_type",$('#property_type').val());
formdata.append("purpose-type",$('#purpose-type').val());
formdata.append("location",$("#txtlocation").val());
formdata.append("rooms",$("#txtrooms").val());
formdata.append("landsize",$("#txtlandsize").val());
formdata.append("bathsize",$("#txtbathsize").val());
formdata.append("housesize",$("#txthousesize").val());
formdata.append("address",$("#txtaddress").val());
formdata.append("description",$("#txtdescription").val());
formdata.append("cost",$("#txtcost").val());
formdata.append("is_negotiable",$("#is_negotiable").val());
formdata.append("name",$("#txtname").val());
formdata.append("phone",$("#txtphone").val());
formdata.append("email",$("#txtemail").val());
formdata.append("_token",$('#_token').val());
jQuery.ajax({
url: 'upload-property',
method: 'POST',
data: formdata,
contentType: false,
processData: false,
beforeSend: function (xhr) {
},
success: function (respond) {
if(respond.success){
window.location.href ='http://localhost/test/public/user-profile';
}
if(!respond.success){
$('#message').html("<div class='alert alert-danger text-center'>"+respond.message+"</div>");
}
},
complete: function (jqXHR, textStatus) {
}
});
});``
Are you sure that url: 'upload-property', get the right url, I personally don't like putting urls like this in .js . You can put your whole url in some hidden field, and then read it from js. Or there are libraries like https://github.com/tightenco/ziggy which let you export your routes, and use your access them by name inside js code
Did you check your settings or what?
THe current questioning could be eliminated by just saying if smaller uploads work
Please or to participate in this conversation.