前端教程
当前位置: 主页 > 教程 > 前端教程
上传支付证书提示文件内容不合法
发布日期:2018-09-26 阅读次数:

上传支付证书提示文件内容不合法

文件地址:crmeb/crmeb/services/upload/storage/Local.php 按下图修改


34d75202411210922424012.jpg

if (in_array($fileHandle->getOriginalMime(), ['image/x-icon', 'image/png', 'image/gif', 'image/jpeg', 'image/jpg'])) {
    $stream = fopen($fileHandle->getPathname(), 'r');
    $content = (fread($stream, filesize($fileHandle->getPathname())));
    if (is_resource($stream)) {
        fclose($stream);
    }
    $image = @imagecreatefromstring($content);
    if ($image === false) {
        return $this->setError('文件内容不合法');
    }
}