Welcome Guest, Not a member yet? Register   Sign In
Download Helper issues
#1

[eluser]quibstar[/eluser]
Having issues with down loading videos. Here is my code:
Code:
function download()
    {
        $this->load->helper('download');
        $name = $this->uri->segment(3);
        $path = '/Users/homdir/Sites/amwayss/videos/'.$this->uri->segment(3);
        $data = file_get_contents($path); // Read the file's content
        force_download($name, $data);            
    }
I just get a blank page when trying to down load .mov files. Other types work e.g wmv, flv and m4v.
#2

[eluser]pistolPete[/eluser]
Enable error displaying and post the error you get:
Code:
error_reporting(E_ALL);
ini_set('display_errors', '1');
#3

[eluser]quibstar[/eluser]
Tried this and I still got a blank page? strange?
#4

[eluser]Unknown[/eluser]
You are getting the black screen because in the $name var you are not specifing the file extension of the file
Do like this
$data = file_get_contents(BASEPATH."uploads\\4CGcjsVs\\454A5d01.pdf");
//echo $data;
$name="ggg.pdf";
echo force_download($name, $data);




Theme © iAndrew 2016 - Forum software by © MyBB