aboutsummaryrefslogtreecommitdiff
path: root/lib/image.php
diff options
context:
space:
mode:
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;
}
/**