From 9f7da5cb396cb2059e5dadcf0a41af33bea3217c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 26 Jun 2011 09:04:40 -0500 Subject: [PATCH] added methods for upload_of. --- system/validation/rules/upload_of.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/system/validation/rules/upload_of.php b/system/validation/rules/upload_of.php index cf1d3393..1b270aaa 100644 --- a/system/validation/rules/upload_of.php +++ b/system/validation/rules/upload_of.php @@ -46,6 +46,29 @@ class Upload_Of extends Rule { } return true; - } + } + + /** + * Set the acceptable file extensions. + * + * @return Upload_Of + */ + public function has_extension() + { + $this->extensions = func_get_args(); + return $this; + } + + /** + * Set the maximum file size in bytes. + * + * @param int $maximum + * @return Upload_Of + */ + public function less_than($maximum) + { + $this->maximum = $maximum; + return $this; + } } \ No newline at end of file