From 2b7c1c940a7bc623d39fc2f5c894f035c193e353 Mon Sep 17 00:00:00 2001 From: bubifengyun Date: Sun, 24 Jan 2016 19:00:20 +0800 Subject: [PATCH] Update Upload.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 开发和部署环境的网站根目录可能改变,源代码相当于写死了文件地址,可能导致部署异常。 --- Uploader.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Uploader.php b/Uploader.php index 467d2d5..a5af6d9 100644 --- a/Uploader.php +++ b/Uploader.php @@ -1,6 +1,7 @@ fullName; - - if (substr($fullname, 0, 1) != '/') { - $fullname = '/' . $fullname; - } - - return $this->config['pathRoot'] . $fullname; + return Yii::getAlias($this->fullName); } /** @@ -338,4 +333,4 @@ public function getFileInfo() "size" => $this->fileSize ); } -} \ No newline at end of file +}