[請益] PHP 上傳的問題
我寫了兩個程式 丟在public_html/tp下面的資料夾 tp權限是777 裡面的兩支程式也是
===========index.php==============
<html>
<head>
<title>檔案上傳</title>
</head>
<body>
<form action="getfile.php" method="post" enctype="multipart/form-data">
上傳檔案:
<input type="file" name="userfile" size=16>
<input type="submit" value="上傳">
<input type="hidden" name="MAX_FILE_SIZE" value="4096000000">
</form>
</body>
</html>
===========getfile.php============
<?php
If ($userfile != "none") {
echo "userfile: $userfile<br>";
echo "userfile_name: $userfile_name (Size: $userfile_size)<br>";
copy($userfile,"./upload/$userfile_name");
unlink($userfile);
echo "上傳完成";
}
else{
echo "沒有檔案";
}
?>
================================
結果開啟index.php有顯示要上傳沒錯,但是無法上傳.jpg檔案, .csv .doc卻可以
不知道哪邊有寫錯誤???
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.223.181
※ 編輯: liwei0321 來自: 140.113.223.181 (12/30 22:22)
推
12/31 00:42, , 1F
12/31 00:42, 1F
→
12/31 03:35, , 2F
12/31 03:35, 2F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章