Código HTML:
Ver original
Código PHP:
Ver original
$submit = $_FILES['imagen'];
Código Javascript:
Ver original
$("#formcambiaravatar").submit(function (e) { e.preventDefault(); $.ajax({ type: 'POST', // define the type of HTTP verb we want to use (POST for our form) url: 'subiravatar', // the url where we want to POST data: $('#formcambiaravatar').serialize(), // our data object dataType: 'json', beforeSend: function () { $("#loader").show(); } }).success(function (data) { $("#loader").hide(); });
En cambio si añado ahí en el formulario un input text, sí que me la coge
