作者 邓超

x

@@ -120,6 +120,11 @@ class UploadFile @@ -120,6 +120,11 @@ class UploadFile
120 // 保存的文件 120 // 保存的文件
121 $this->saveName = '/storage/'.($name ? $name : md5_file($this->tempFile).'.'.$this->ext); 121 $this->saveName = '/storage/'.($name ? $name : md5_file($this->tempFile).'.'.$this->ext);
122 122
  123 + // 验证目录
  124 + if(!is_dir(dirname($this->savePath.$this->saveName))){
  125 + @mkdir(dirname($this->savePath.$this->saveName),0775,true);
  126 + }
  127 +
123 if($this->isUpload){ 128 if($this->isUpload){
124 return move_uploaded_file($this->tempFile,$this->savePath.$this->saveName); 129 return move_uploaded_file($this->tempFile,$this->savePath.$this->saveName);
125 }else{ 130 }else{