aboutsummaryrefslogtreecommitdiff
path: root/lib/image.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-24 21:08:27 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-24 21:08:27 +0000
commitda1493b95a2f0b5000a487ae373c9318c58d0b2d (patch)
treea339b053ade9fb15a1717bdf248a59afc9b3d239 /lib/image.php
parent5161b1c8fdc8ff69005f864a89127fc18db6d4ed (diff)
downloadelgg-da1493b95a2f0b5000a487ae373c9318c58d0b2d.tar.gz
elgg-da1493b95a2f0b5000a487ae373c9318c58d0b2d.tar.bz2
partial implementation of flash uploader
Diffstat (limited to 'lib/image.php')
-rw-r--r--lib/image.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/image.php b/lib/image.php
index 51b31f6d7..c68560df6 100644
--- a/lib/image.php
+++ b/lib/image.php
@@ -55,12 +55,22 @@ class TidypicsImage extends ElggFile {
*
* @warning filename needs to be set first
*
- * @param string $image
+ * @param string $uploadedFilename name of the uploaded file
+ * @param int $size
*/
- public function saveImageFile($image) {
- $this->open("write");
- $this->write($image);
- $this->close();
+ public function saveImageFile($uploadedFilename, $size) {
+
+ $filename = $this->getFilenameOnFilestore();
+
+ $result = move_uploaded_file($uploadedFilename, $filename);
+ if (!$result) {
+ return false;
+ }
+
+ $owner = $this->getOwnerEntity();
+ $owner->image_repo_size = (int)$owner->image_repo_size + $size;
+
+ return true;
}
/**