Upload file problem

i used this code to upload file but it remove The first word of the name of the file

$notefile =   basename( $_FILES['file']['name']) ;
$target_path = "files/";

$target_path = $target_path . basename( $_FILES['file']['name']); 
if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
 echo "";

} else{
 echo "";
}

what is the problem?

The code should normally work but you’ll have to make sure your “files/” directory exists AND it has CHMOD 777. Save the following test code as a file in your website’s root directory and use it if you want clarifications:

<?php
if (function_exists("ini_set")) {
	ini_set("error_reporting", E_ALL);
	ini_set("display_errors", 1);
}
if (!empty($_FILES)) {
	$notefile = basename($_FILES['file']['name']);
	$target_path = "files/";

	$errors = array();
	if (function_exists("ini_get")) {
		$tmp_dir = ini_get("upload_tmp_dir");
		if (!file_exists($tmp_dir)) {
			$errors[] = "You don't have a temporary upload directory set in php.ini.";
		} else {
			if (!is_writable($tmp_dir)) {
				$errors[] = "Your temporary upload directory is not writable.";
			}
		}
	}
	if (empty($notefile)) {
		$errors[] = "The filename is empty (not valid).";
	}
	if (!file_exists($target_path)) {
		$errors[] = "The target path does not exist.";
	}
	if (!is_writable($target_path)) {
		$errors[] = "The target path is not writable.";
	}

	if (empty($errors)) {
		$target_path = $target_path . $notefile;
		if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
			echo "The file was uplodaded successfully.";
		} else {
			echo "The file could not be uploaded.";
		}
	} else {
		echo "The file could not be uploaded. See the error list below:<br />";
		foreach ($errors as $error)
			echo "> " . $error . "<br />";
	}
	echo "<a href='".basename(__FILE__)."'>Make another upload test.</a>";
} else {
?>
Test file upload:<br />
<form action='<?php echo basename(__FILE__); ?>' method='post' enctype='multipart/form-data'>
<input type='file' name='file' />
<input type='submit' value='Upload the file' />
</form>
<?php
}
?>