From 6410e83377fc07fcae1e75f1ba838d86dd2ed774 Mon Sep 17 00:00:00 2001 From: Michael Hasselbring Date: Sat, 25 Jun 2011 23:35:38 -0500 Subject: [PATCH] Created File::upload() --- system/file.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/file.php b/system/file.php index b46ca705..6eb42f2c 100644 --- a/system/file.php +++ b/system/file.php @@ -186,4 +186,15 @@ public static function download($path, $name = null) return $response; } + /** + * Move uploaded file, Use $_FILES['file'] for $file + * + * @param array $file + * @param string $path + * @return bool + */ + public static function upload($file, $path) + { + return ( ! move_uploaded_file($file['tmp_name'], $path)) ? false : true; + } } \ No newline at end of file