Commit b300fa5d authored by rlgy's avatar rlgy

update

parent 50643e9e
......@@ -39,13 +39,16 @@ class Uploader extends Component
* 上传文件
* @param $uploaded_file UploadedFile
* @param $savename string 文件保存名
* @return bool|string 文件rui or false
* @throws Exception
* @return bool|string 文件rui or false
*/
public function upload($uploaded_file, $savename = '')
{
if (empty($savename)) {
$savename = md5(date('Y-m-d H:i:s') . $uploaded_file->tempName) . '.' . $uploaded_file->extension;
$savename = md5(date('Y-m-d H:i:s') . $uploaded_file->tempName);
if ($uploaded_file->extension) {
$savename = $savename . '.' . $uploaded_file->extension;
}
}
$this->absolute = rtrim(str_replace('\\', '/', $this->absolute), '/') . '/';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment