Good afternoon! I am creating a multiple file upload with jQuery / AJAX and PHP. Doing tests, I've noticed that when I select a total of + 3mb of files, it does not upload me. When it's less than that, it does.
I have looked at my phpinfo and I have seen that the parameter upload_max_filesize is 64M, but looking more, I have seen that the parameter post_max_size is 3M. I think that's the problem, that when uploading it with POST my server compares with post_max_size instead of upload_max_filesize.
If I do not want to change the post_max_size parameter ... how can I make the AJAX request to take it as a file upload instead of a POST?
function subir_adjuntos_licencia(){
//Creamos un objeto formData
var fd = new FormData();
//fd.append("estado", $("#selestados option:selected").val());
for (var i=0, len=document.getElementById('adjuntos_licencia').files.length; i< len; i++)
{
fd.append("adjuntos_licencia"+i , document.getElementById('adjuntos_licencia').files[i]);
}
//Petición AJAX
$.ajax({
url : "<?= site_url('admin/licencias/detalle_licencia_usuario/subir_adjuntos_licencia_usuario?ins='.$institucion_id.'&lic='.$id_licencia);?>",
type: "POST",
data : fd,
processData: false,
contentType: false,
success:function(data, textStatus, jqXHR){
if(data.error == false)
{
$("#adjuntos_licencia").fileinput('clear');
toastr.success(data.mensaje);
}
else
{
toastr.error(data.mensaje);
}
},
error: function(jqXHR, textStatus, errorThrown){
toastr.error(textStatus);
}
});
}