summaryrefslogtreecommitdiff
path: root/htdocs/src
diff options
context:
space:
mode:
authorjesse <jesse@jesterpm.net>2011-05-26 14:52:42 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-05-26 14:52:42 -0700
commit7af236e2dea03ae3086f4d21e0ae1039c7ac3555 (patch)
tree9d6fb5e76e3a4b16bc42b53339ff67d8735dcf3a /htdocs/src
parente61cd160107544d2437827e7fda59450c4dca2c6 (diff)
Working on image upload
Diffstat (limited to 'htdocs/src')
-rw-r--r--htdocs/src/Post.inc.php14
1 files changed, 14 insertions, 0 deletions
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());