Re: [請益]關於上傳
※ 引述《chobitsppc (無止盡的道路)》之銘言:
可以從這邊找到答案:
http://tw.php.net/manual/en/function.is-uploaded-file.php
if (is_uploaded_file($userfile)) {
//include code to copy tmp file to final location here...
}else{
switch($HTTP_POST_FILES['userfile']['error']){
case 0:
//no error; possible file attack!
echo "There was a problem with your upload.";
break;
case 1:
//uploaded file exceeds the upload_max_filesize directive in php.ini
echo "The file you are trying to upload is too big.";
break;
case 2:
//uploaded file exceeds the MAX_FILE_SIZE directive that was
//specified in the html form
echo "The file you are trying to upload is too big.";
break;
case 3:
//uploaded file was only partially uploaded
echo "The file you are trying upload was only partially uploaded.";
break;
case 4:
//no file was uploaded
echo "You must select an image for upload.";
break;
default:
//a default error, just in case! :)
echo "There was a problem with your upload.";
break;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.222.26.129
推
08/28 17:17, , 1F
08/28 17:17, 1F
→
08/28 17:17, , 2F
08/28 17:17, 2F
→
08/28 17:19, , 3F
08/28 17:19, 3F
推
08/28 18:13, , 4F
08/28 18:13, 4F
→
08/28 19:11, , 5F
08/28 19:11, 5F
推
08/28 20:57, , 6F
08/28 20:57, 6F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章