container_guid = $album->getGUID(); $image->setMimeType($file['type']); $image->access_id = $album->access_id; $image->batch = $batch; try { $result = $image->save($file); } catch (Exception $e) { // remove the bits that were saved $image->delete(); $result = false; echo $e->getMessage(); } if ($result) { $album->prependImageList(array($image->guid)); if (elgg_get_plugin_setting('img_river_view', 'tidypics') === "all") { elgg_create_river_item(array('view' => 'river/object/image/create', 'action_type' => 'create', 'subject_guid' => $image->getOwnerGUID(), 'object_guid' => $image->getGUID(), )); } } exit;