Is it safe to upload images via MySQL in Blob? I've constructed my code like the following:    public function upload_avatar($file, $user_id = false, $maxbytes = 102400) {    global $sql;    if($user_id == false) {        $user_id = $this->_id;    }    $check = getimagesize($file);    if($check == false) {        return false;    }    $width = $check[0];    $height = $check[1];    if($width > 300) {        return false;    }    if($height > 300) {        return false;    }    $fp = fopen($file, 'rb');    if(strlen($file) < $maxbytes) {        $q = $sql->prepare(UPDATE `users` SET `avatar` = :file WHERE id = :user_id;);        try {            $q->bindParam(':file', $fp, PDO::PARAM_LOB);            $q->bindParam(':user_id', $user_id);            $q->execute();        }        catch(PDOException $e) {            die($e->getMessage());        }        return true;    } else {        return false;    }}Is it possible for a hacker to upload viruses via this script?
Uploading images via MySQL in Blob
php;mysql;security;image;pdo