Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
AJAX sends file, but PHP wont receive it, if file is too large (but it is not)

I am using AJAX to upload two images (in base64 encoding). It works perfectly fine if the images are small (e.g. 500kB one image and 300kB the other, <1MB in total). However, if the images are larger (e.g. 1.5MB and 300kB), the larger image is not recieved by PHP (only the other one can be seen). That suggests that a limit could be reached on the server side, however the PHP parameters post_max_size and upload_max_filesize are set to 256MB, so should not be a problem.

Any ideas what can be wrong?

Here is the ajax:

$.ajax({
    url:'upload.php',
    method:'POST',
            contentType:"application/x-www-form-urlencoded",
    data: {orig:original,image:cropped},
    success:function(data)
    {
        $modal.modal('hide');
    }
});

Here is the PHP code:

echo print_r($_POST);

Here is the PHP setup:

file_uploads    On
max_execution_time  120
max_file_uploads    20
post_max_size   256M
upload_max_filesize 256M
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

After discussion with webhosting admins we discovered that the issue was caused by nginx limit client_max_body_size, which was set to 1MB.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda