Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda