New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

PHP Upload does not send files.

Started by tiagocaus, July 13, 2019, 01:56:42 PM

Previous topic - Next topic

tiagocaus

I ran a cPanel test and the upload works, but the CWP server is not sending the file.

No error appears, shows all the upload procedure, it registers in the database, but the file does not send.

My code:


<?php
if ((isset($_POST["form"])) && ($_POST['form'] == "form1")) {

  
$ext = strtolower(substr($_FILES['arquivo']['name'],-4)); //Pegando extensão do arquivo
  
$arquivo = "file_".date('dmYhis') . $ext; //Definindo um novo nome para o arquivo
  
$dir = __DIR__.'/uploads/aulas/'; //Diretório para uploads
  
move_uploaded_file($_FILES['arquivo']['tmp_name'], $dir.$arquivo); //Fazer upload do arquivo

}
?>



  <form id="form" method="post" autocomplete="off" enctype="multipart/form-data">
    <div class="row">
      <div class="col-xs-6">
        <div class="form-group">
          <label class="control-label">Arquivo (.zip .rar .pdf)</label>
          <input name="arquivo" type="file" id="file-1" required />
        </div>
      </div>

      <button type="submit" id="button" name="button" class="btn btn-success pull-right"><i class="icon-save bigger-110"></i> Salvar</button>
  </form>

pidje

Hi,

Same problem here , did you find the solution?