How can I keep the same name of a file at the time of upload, for example if the person chooses a file with the name worksheet.pdf I can always record it with a fixed name, as document.pdf, today I do this in my script:
$arquivo = $_FILES["arquivo_pdf"];
$arquivo_nome = $arquivo["name"];
// Move o arquivo para o diretório especificado
set_time_limit(0);
$diretorio = "../diretorio/";
$arquivo_temporario = $_FILES['arquivo_pdf']["tmp_name"];
move_uploaded_file($arquivo_temporario, $diretorio.$arquivo_nome);
Being $ file_name is what I always want to leave with the same name.