I have a strange problem: my form works for uploading images but does not work for uploading PDF files.
My code is as follows:
$titulo = $_POST['txtTitulo'];
$descricao = $_POST['txtDescricao'];
$extension = pathinfo($_FILES['flFile']['name']);
$extension = ".".$extension['extension'];
$extension != '.';
$file = md5(time().rand()).$extension;
$anexo = 'assets/uploads/'.$file;
move_uploaded_file( $_FILES['flFile']['tmp_name'], $anexo );
$query = "insert into tb_arquivos (id_arquivo, titulo, descricao, anexo)
values (null, '".$titulo."', '".$descricao."', '".$anexo."')";
mysql_query($query) or die (mysql_error());
If I insert an image, everything works perfectly. But if I insert a PDF, I lose all form values (including those of the $ title and $ description variables.)
Can anyone help me?
Thank you very much!