[eluser]Cristian Gilè[/eluser]
Add the following method to your controller (or library or helper):
Code:
function get_video_from_url($link)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec($ch);
curl_close($ch);
return $result;
}
call the new method and save the file locally:
Code:
$video = $this->get_video_from_url("http://vod.cms.download.performgroup.com/omnisport/ready/french/162/fr-050612-ireland_1338883384151_162.m4v");
if ( ! write_file('./video.m4v', $video))
{
echo 'Unable to write the file';
}
else
{
echo 'File written!';
}