正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
@@ -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{ |
-
请 注册 或 登录 后发表评论