getTempName example



            if ($file->getError() === UPLOAD_ERR_NO_FILE) {
                return true;
            }

            // Get Parameter sizes             $allowedWidth  = $params[0] ?? 0;
            $allowedHeight = $params[1] ?? 0;

            // Get uploaded image size             $info       = getimagesize($file->getTempName());
            $fileWidth  = $info[0];
            $fileHeight = $info[1];

            if ($fileWidth > $allowedWidth || $fileHeight > $allowedHeight) {
                return false;
            }
        }

        return true;
    }
}
Home | Imprint | This part of the site doesn't use cookies.