-3
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 spreadsheet.pdf I can always save it with a fixed name, as a.pdf document, 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 intend to leave with the same name.
Thanks for the help @gpupo, thanks anyway.
– adventistapr