Uploader::base64ToImage PHP Method

base64ToImage() private method

处理base64编码的图片上传
private base64ToImage ( $base64Data ) : mixed
$base64Data
return mixed
    private function base64ToImage($base64Data)
    {
        $img = base64_decode($base64Data);
        $this->fileName = time() . rand(1, 10000) . '.png';
        $this->fullName = $this->getFolder() . '/' . $this->fileName;
        if (!file_put_contents($this->fullName, $img)) {
            $this->stateInfo = $this->getStateInfo('IO');
            return;
        }
        $this->oriName = '';
        $this->fileSize = strlen($img);
        $this->fileType = '.png';
    }