public function allowedUpload($originalFilename)
    {
        // Check if file_uploads ini directive is true
        if (Ini::getBool('file_uploads') === false) {
            throw new IOException('File uploads are not allowed, check the file_uploads ini directive.');
        }
        // no UNIX-hidden files
        if ($originalFilename[0] === '.') {
            return false;
        }
        // only whitelisted extensions
        $extension = pathinfo($originalFilename, PATHINFO_EXTENSION);
        $allowedExtensions = $this->getAllowedUploadExtensions();

        return in_array($extension, $allowedExtensions);
    }