Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/05/2016, 08:30
infoturnosya
 
Fecha de Ingreso: diciembre-2015
Ubicación: rosario
Mensajes: 69
Antigüedad: 8 años, 5 meses
Puntos: 5
Respuesta: Subir imagen con Jquery Ajax

Si no te es muy drástico cambia el $.post por $.ajax y para enviar archivos el parametro processData:false siempre debe estar en false

Código Javascript:
Ver original
  1. $.ajax({
  2. url: "ajax_php_file.php", // Url to which the request is send
  3. type: "POST",             // Type of request to be send, called as method
  4. data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
  5. contentType: false,       // The content type used when sending data to the server.
  6. cache: false,             // To unable request pages to be cached
  7. processData:false,        // To send DOMDocument or non processed data file it is set to false
  8. success: function(data)   // A function to be called if request succeeds
  9. {
  10. $('#loading').hide();
  11. $("#message").html(data);
  12. }
  13. });