Adding has_file method

Signed-off-by: Koen Schmeets <k.schmeets@gmail.com>
This commit is contained in:
Koen Schmeets 2012-04-26 21:24:06 +02:00
parent 26730cd5b3
commit 33c6027476
1 changed files with 12 additions and 0 deletions

View File

@ -178,6 +178,18 @@ public static function file($key = null, $default = null)
return array_get($_FILES, $key, $default);
}
/**
* Determine if the uploaded data contains a file.
*
* @param string $key
* @return bool
*/
public static function has_file($key)
{
$file = static::file($key);
return ! empty($file['tmp_name']);
}
/**
* Move an uploaded file to permanent storage.
*