From 8ccd45aa77d290906fd42dcf5520a434303d4f68 Mon Sep 17 00:00:00 2001 From: Sem Date: Sat, 25 Feb 2012 01:38:29 +0100 Subject: Saving thumbnails in server and serving them secure. --- actions/videolist/edit.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actions') diff --git a/actions/videolist/edit.php b/actions/videolist/edit.php index 6670ceadb..be566de7e 100644 --- a/actions/videolist/edit.php +++ b/actions/videolist/edit.php @@ -71,6 +71,18 @@ $video->container_guid = $container_guid; if ($video->save()) { elgg_clear_sticky_form('videolist'); + + // Let's save the thumbnail in the data folder + $thumbnail = file_get_contents($video->thumbnail); + if ($thumbnail) { + $prefix = "videolist/" . $video->guid; + $filehandler = new ElggFile(); + $filehandler->owner_guid = $video->owner_guid; + $filehandler->setFilename($prefix . ".jpg"); + $filehandler->open("write"); + $filehandler->write($thumbnail); + $filehandler->close(); + } system_message(elgg_echo('videolist:saved')); -- cgit v1.2.3