From 7af236e2dea03ae3086f4d21e0ae1039c7ac3555 Mon Sep 17 00:00:00 2001 From: jesse Date: Thu, 26 May 2011 14:52:42 -0700 Subject: Working on image upload --- htdocs/src/Post.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'htdocs/src/Post.inc.php') diff --git a/htdocs/src/Post.inc.php b/htdocs/src/Post.inc.php index 6dec593..34230b2 100644 --- a/htdocs/src/Post.inc.php +++ b/htdocs/src/Post.inc.php @@ -186,6 +186,20 @@ class Post { return $this->info['location']; } + public function addImage($file) { + // TODO: Verify file type + + // TODO: Unique name for file. + $newfile = $GLOBALS['CONFIG']['uploads']; + + if (move_uploaded_file($file, $newfile)) { + return true; + + } else { + return false; + } + } + public function sendValidation() { $email = new Email($this->getEmail()); -- cgit v1.2.3