Author Topic: PHP Upload does not send files.  (Read 4639 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP Upload does not send files.
« on: July 13, 2019, 01:56:42 PM »
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:

Code: [Select]
<?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>

Offline
*
Re: PHP Upload does not send files.
« Reply #1 on: August 31, 2019, 11:12:35 PM »
Hi,

Same problem here , did you find the solution?