i want if file is .txt upload to uploaded but when im upload i .txt file his says that not a .txt file can anyone fix full code plzz
i want if file is .txt upload to uploaded that not a .txt file can anyone fix full code plzz
$dir_name =dirname(__FILE__)."/uploaded/";
$path = $_FILES['file']['tmp_name'];
$name = $_FILES['file']['name'];
$type = $_FILES['file']['type'];
$size = $_FILES['file']['size'];
$error = $_FILES['file']['error'];
if ($_POST['zrup'] && in_array($type,array('.txt'))){
move_uploaded_file($path,$dir_name.$name);
echo 'Done .txt';
}else{
echo 'That Not .txt!!!';
}
ob_end_flush();
?>
<br /><br />
<center>
<hr />
<br />
<br />
<br />
<form action="tshfersystem.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="upload" name="zrup" />
</form>
Aucun commentaire:
Enregistrer un commentaire