◀ Previous Next ▶ Up ▲


witpoko.com


อัพโหลดไฟล์ไม่ได้ ช่วยดูหน่อยครับ

ผมทำ upload file แต่มันไม่สามารถเก็บไฟล์ได้ (ที่ D:/photo) ขอคำแนะนำด้วยครับ

upload_form.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>:: Upload File ::</title>
</head>
<body>
<form method = "post" action = "upload_send2.php" enctype="multipart/form-data">
<h2>Upload File</h2>
<input type = "hidden" name = "max_file_size" value = "100000" />
<input type = "file" name = "fileupload" /><br />
<input type = "submit" value = "upload file" />
</form>
</body>
</html>

upload_send.php
<?
$fileupload = $_FILES['fileupload']['tmp_name'];
$fileupload_name = $_FILES['fileupload']['name'];
$fileupload_type = $_FILES['fileupload']['type'];
$fileupload_size = $_FILES['fileupload']['size'];

if($fileupload)
{
echo "file position: $fileupload<br>";
echo "file name: $fileupload_name<br>";
echo "file size: $fileupload_size<br>";
echo "file type: $fileupload_type<br>";

copy($fileupload, "D:/photo/".$fileupload_name);
echo "<h3>Upload successfully</h3>";
unlink($fileupload);
}else{
echo "<h3>Error: Upload Fail</h3>";
}

?>


จากคุณ : ต๋อง -[ 2 ก.ย. 52 - 09:15:16 A:58.9.195.187 X: ]



Bookmark and Share





กระทู้ยอดนิยม