continue;
}
- //this will save to users folder in /image/ and organize by photo album
+ //this will save to user's folder in /image/ and organize by photo album
$file = new TidypicsImage();
$file->container_guid = $album_guid;
$file->setMimeType($mime);
- $file->simpletype="image";
+ $file->simpletype = "image";
$file->access_id = $access_id;
//$file->title = substr($name, 0, strrpos($name, '.'));
*/
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);