diff options
author | Cash Costello <cash.costello@gmail.com> | 2010-10-24 21:08:27 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2010-10-24 21:08:27 +0000 |
commit | da1493b95a2f0b5000a487ae373c9318c58d0b2d (patch) | |
tree | a339b053ade9fb15a1717bdf248a59afc9b3d239 /lib/image.php | |
parent | 5161b1c8fdc8ff69005f864a89127fc18db6d4ed (diff) | |
download | elgg-da1493b95a2f0b5000a487ae373c9318c58d0b2d.tar.gz elgg-da1493b95a2f0b5000a487ae373c9318c58d0b2d.tar.bz2 |
partial implementation of flash uploader
Diffstat (limited to 'lib/image.php')
-rw-r--r-- | lib/image.php | 20 |
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; } /** |