0
Can anyone tell me why the file is not being received in the destination folder?
private $id;
private $entrada;
private $saida;
private $status;
public function __construct($bd) {
$this->bd = $bd;
}
public function construirObjeto($entrada, $saida, $status) {
$this->entrada = $entrada;
$this->saida = $saida;
$this->status = $status;
}
public function inserir(){
$origem = $_FILES["arquivo"]["tmp_name"];
$entradaa = "emboss/aaindexextract/" . $_FILES["arquivo"]["name"];
if($entradaa){
$sql = "INSERT INTO caminhoarquivo(entrada, saida, status) VALUES ('$entradaa', 'NULL', 'SOLICITADO')";
$this->bd->executarSql($sql);
}else{
echo "Erro!";
}
//salva foto no diretorio
move_uploaded_file($origem, $entradaa);
}
Check the permissions of the destination folder
– NoobSaibot
The data is being entered into the database?
– NoobSaibot
yes data is being entered only without the $_FILES["file"]["name"] only Emboss/aaindexextract/
– Lucas
do a debug then use: print_r($_FILES["file"] or var_dump($_FILES["file"]
– NoobSaibot
I have already performed the debug, nothing is coming in $_FILES["file"] .
– Lucas
Then see if the html form tag has the attribute: enctype="Multipart/form-data"
– NoobSaibot
Thank you so much for the help, I had even forgotten to put the enctype="Multipart/form-data
– Lucas