I want to upload a file from my android application. The first time it happens successfully but the second time if I want to replace the file it won't do anything.
<?php
$file_path = "usuario/";
$file_path = $file_path . basename( $_FILES['uploaded_imagen']['name']);
if(file_exists($file_path))
{
unlink($file_path);
}
if(move_uploaded_file($_FILES['uploaded_imagen']['tmp_name'], $file_path)) {
echo "success1";
} else{
echo "fail1";
}
?>