From da1493b95a2f0b5000a487ae373c9318c58d0b2d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 24 Oct 2010 21:08:27 +0000 Subject: partial implementation of flash uploader --- lib/image.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'lib/image.php') 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; } /** -- cgit v1.2.3