File uploads are handled by move_uploaded_file()
The first attribute is the temp name of the file stored in the $FILES array in the form $FILES['(name of file upload field goes here - in your case archivo)']['tmp_name']
The second attribute is the file path to where you want it saved (you had this bit right)
if ($_POST['btn1'] == "Enviar")
{
move_uploaded_file($_FILES['archivo']['tmp_name'], $dir.$filename);
}
No unlink is needed as the file is moved rather than copied from the temp folder to it's final location.
If a file of the same name already exists it will be overwritten. A function you can use to prevent this is available from the page I linked to above.