From 075f05aaf9dfccc4a8a1e5741462ec4ee42ae743 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sat, 2 Dec 2017 00:13:43 +0100 Subject: add handling of file parameters --- functions.http.inc.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/functions.http.inc.php b/functions.http.inc.php index 1cdbea7..19f3e9e 100644 --- a/functions.http.inc.php +++ b/functions.http.inc.php @@ -86,6 +86,22 @@ function getHeaderValue($headerName) { return $_SERVER[$headerName]; } +function getFileParameter($parameterName) { + return $_FILES[$parameterName]; +} + +function getOptionalFileParameter($parameterName, $default = NULL) { + $parameter = getFileParameter($parameterName); + + return handleOptionalParameter($parameter, $default); +} + +function getMandatoryFileParameter($parameterName, $message = '', $json = false) { + $parameter = getFileParameter($parameterName); + + return handleMandatoryParameter($parameterName, $parameter, $message, $json); +} + function getPostParameter($parameterName) { return $_POST[$parameterName]; } -- cgit v1.2.3