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

188
Visualizações
Why WordPress ajax call is showing bad request (0)

I am trying to upload files ( image, video, and zip ) from the front-end using jQuery Ajax call.

Here is the jQuery code:

$(document).on("submit", "#add_training_video", function (e) {
  e.preventDefault();
  var form = $(this);
  var actionUrl = handle.ajaxurl;
  var data = new FormData(this);

  $.ajax({
    dataType: "html",
    type: "POST",
    url: actionUrl,
    data: data,
    processData: false,
    contentType: false,
    beforeSend: function () {
      $(".video-button").val("Please wait...");
      $(".video-button").prop("disabled", true);
    },
    success: function (data) {
      $(".video-button").val("Add A New Video");
      $(".video-button").prop("disabled", false);
      $(".ajax_response").html(data);
      // console.log(data);
      // $(".ajax_response").html("");
      // if(!data.success) {
      //   data.message.forEach(function(key, ele){
      //     $(".ajax_response").append("<div class='error-message'>" + key +"</div>");
      //   });
      // } else {
      //   $(".ajax_response").append("<div class='success-message'>" + data.message +"</div>");
      // }
    },
  });
});

Now, If I upload a file that is more than 5 MB then I am getting a 0 or Bad Request from ajax response.

Can you tell me why?

Thank You!

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Your server has POST file size limit with 5mb (default conf).

Edit your php.ini config with lines:

post_max_size=20M
upload_max_filesize=20M
over 4 years ago · Santiago Trujillo 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