FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

上传文件路径计算 · internet-dev/framework@c9535b4 · GitHub

Repository navigation

Commit c9535b4

Browse files
committed
上传文件路径计算
1 parent e33bab7 commit c9535b4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎libs/Swoole/Upload.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ function __construct($config)
6969
throw new \Exception(__CLASS__.' require base_dir and base_url.');
7070
}
7171
$this->base_dir = $config['base_dir'];
72+
if (Tool::endchar($this->base_dir) != '/')
73+
{
74+
$this->base_dir .= '/';
75+
}
7276
$this->base_url = $config['base_url'];
7377
$mimes = require LIBPATH . '/data/mimes.php';
7478
$this->mimes = $mimes;
@@ -112,7 +116,7 @@ function save($name, $filename = null, $allow = null)
112116
}
113117

114118
//文件存储的路径
115-
$base_dir = empty($this->sub_dir) ? $this->base_dir : $this->base_dir . "/" . $this->sub_dir;
119+
$base_dir = empty($this->sub_dir) ? $this->base_dir : $this->base_dir . $this->sub_dir . '/';
116120

117121
//切分目录
118122
if ($this->shard_type == 'randomkey')

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL