aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-06-05 16:58:09 +0000
committerCash Costello <cash.costello@gmail.com>2011-06-05 16:58:09 +0000
commitfba844ea760259a3a317eb1454294bc6361e7b4a (patch)
treeb6e29c667801e16066169327c83e2ecce58202d7 /lib
parent881307d9dc5dba4c73b6898a4079ef8f507a90e2 (diff)
downloadelgg-fba844ea760259a3a317eb1454294bc6361e7b4a.tar.gz
elgg-fba844ea760259a3a317eb1454294bc6361e7b4a.tar.bz2
Fixes #141 forcing the creation of album directory in user directories for group album
Diffstat (limited to 'lib')
-rw-r--r--lib/image.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/image.php b/lib/image.php
index 7f98a08d7..14ac2e688 100644
--- a/lib/image.php
+++ b/lib/image.php
@@ -60,6 +60,13 @@ class TidypicsImage extends ElggFile {
*/
public function saveImageFile($uploadedFilename, $size) {
+ // we need to make sure the directory for the album exists
+ // @note for group albums, the photos are distributed among the users
+ $dir = tp_get_img_dir() . $this->getContainer();
+ if (!file_exists($dir)) {
+ mkdir($dir, 0755, true);
+ }
+
$filename = $this->getFilenameOnFilestore();
$result = move_uploaded_file($uploadedFilename, $filename);