老師寫錯了,正確的應該是
/**
* 檢測是否是真實圖片
* @return boolean
*/
protected function checkTrueImg(){
if($this->imgFlag){
if(!getimagesize($this->fileInfo['tmp_name'])){
$this->error='不是真實圖片';
return false;
}
}
return true;
}
/**
* 檢測是否是真實圖片
* @return boolean
*/
protected function checkTrueImg(){
if($this->imgFlag){
if(!getimagesize($this->fileInfo['tmp_name'])){
$this->error='不是真實圖片';
return false;
}
}
return true;
}
2016-10-31
看著視頻寫的代碼,打印print_r($_files);時,報錯:PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0,及時解決了,存放文件的臨時目錄沒有了,在php.ini中找到;upload_tmp_dir =(然后去掉前面的分號,在=號后面添加一個目錄就ok了)
2016-10-23