0
<?php
$dir = "arquivo";
$file = $_FILES["csv1"];
if (file_exists('arquivo/dados.csv')) {
echo "Um arquivo já foi enviado! Envie outro arquivo!";
exit;
} else {
if (move_uploaded_file($file["tmp_name"], "{$dir}/dados.csv")) {
echo "Arquivo enviado com sucesso!";
} else {
echo "Erro, o arquivo não pode ser enviado.";
}
}
how do I do it? type if add another it overwrites does not add a new file
– gobiraaaa
"{$dir}/dados.csv"
will be the name of the file you save to the server. Simply change the value ofdados.csv
– Woss
but I want to add two csv files with same name sera that have as ?
– gobiraaaa
Other Generate unique name for file after upload
– Woss
I didn’t understand those ways as you would ?
– gobiraaaa
In these ways, generating a unique name for each file sent...
– Woss
edits the code for me to see how you would do is that I don’t know much of php kk
– gobiraaaa