src/Upload.php
public function getFile($tag)
    {
        $file = $_FILES[$tag];

        if (!isset($file) || empty($file)) {
            return; //没有上传文件
        }

        $num = count($file['name']); //PHP上传类upload.php上传文件的个数

        $data = array(); //用来保存上传文件的信息的数组
        //上传了多个文件
        if ($num > 1) {
            for ($i = 0; $i < $num; $i++) {
                $d             = array();
                $d['name']     = $file['name'][$i];
                $d['type']     = $file['type'][$i];
                $d['tmp_name'] = $file['tmp_name'][$i];
                $d['error']    = $file['error'][$i];
                $d['size']     = $file['size'][$i];
                $pics          = explode('.', $file['name'][$i]);
                $d['postfix']  = $pics[count($pics) - 1];
                $d['filename'] = date('Ymdh', time()) . rand(10000, 99999) . '.' . $d['postfix'];

                if ($d['error'] == 0) {
                    $data[] = $d;
                } else {
                    @unlink($d['tmp_name']);
                }
            }
        }
        //只上传了一个文件
        else {
            $d             = array();
            $d['name']     = $file['name'];
            $d['type']     = $file['type'];
            $d['tmp_name'] = $file['tmp_name'];
            $d['error']    = $file['error'];
            $pics          = explode('.', $file['name']);
            $d['postfix']  = $pics[count($pics) - 1];
            $d['filename'] = date('Ymdh', time()) . rand(10000, 99999) . '.' . $d['postfix'];

            if ($d['error'] == 0) {
                $data[] = $d;
            } else {
                @unlink($d['tmp_name']);
            }
        }

        if (empty($data)) {
            return;
        }

        $this->file = $data; //保存上传文件的信息
    }
public function getFile($tag)
    {
        $file = $_FILES[$tag];

        if (!isset($file) || empty($file)) {
            return; //没有上传文件
        }

        $num = count($file['name']); //PHP上传类upload.php上传文件的个数

        $data = array(); //用来保存上传文件的信息的数组
        //上传了多个文件
        if ($num > 1) {
            for ($i = 0; $i < $num; $i++) {
                $d             = array();
                $d['name']     = $file['name'][$i];
                $d['type']     = $file['type'][$i];
                $d['tmp_name'] = $file['tmp_name'][$i];
                $d['error']    = $file['error'][$i];
                $d['size']     = $file['size'][$i];
                $pics          = explode('.', $file['name'][$i]);
                $d['postfix']  = $pics[count($pics) - 1];
                $d['filename'] = date('Ymdh', time()) . rand(10000, 99999) . '.' . $d['postfix'];

                if ($d['error'] == 0) {
                    $data[] = $d;
                } else {
                    @unlink($d['tmp_name']);
                }
            }
        }
        //只上传了一个文件
        else {
            $d             = array();
            $d['name']     = $file['name'];
            $d['type']     = $file['type'];
            $d['tmp_name'] = $file['tmp_name'];
            $d['error']    = $file['error'];
            $pics          = explode('.', $file['name']);
            $d['postfix']  = $pics[count($pics) - 1];
            $d['filename'] = date('Ymdh', time()) . rand(10000, 99999) . '.' . $d['postfix'];

            if ($d['error'] == 0) {
                $data[] = $d;
            } else {
                @unlink($d['tmp_name']);
            }
        }

        if (empty($data)) {
            return;
        }

        $this->file = $data; //保存上传文件的信息
    }
/*获取file