ERROR : POST http:/php/Reportfisico.php net::ERR_CONTENT_LENGTH_MISMATCH

Asked

Viewed 68 times

0

Does anyone know why this error is happening when I go to download a spreadsheet... Being that if I refresh the page the error does not happen again

Controller

$scope.GerarPlanilha = function (){
  $http({
              url: 'http:/php/RelatorioFisico.php',
              method: 'POST',
              responseType: 'arraybuffer',
              headers: {
                  'Content-type': 'application/json',
                  'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
              }
          }).success(function(data){
              var blob = new Blob([data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
              saveAs(blob,'ContratosPendentes'+'.xlsx');
          }).error(function(){

          });
      };
  • guess missing specify file size.. Content-Length

  • no controller?? because in my php headers I header('Content-Length: ' . filesize($file));

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.