Welcome Guest, Not a member yet? Register   Sign In
Using Download Helper With Extremely Large Files
#3

[eluser]dawnerd[/eluser]
That's actually how I'm doing it now. Here's a snippet from my download controller:
Code:
function paid()
    {
        //Check if user is logged in
        if(!$this->users->isLoggedIn())
        {
            echo "Not allowed.";
            return false;
        }
        
        $requested_file = $this->uri->segment(3);
        
        $query = $this->db->getwhere('downloads', array('id'=>$requested_file));
        foreach ($query->result() as $row)
        {
            
            $file_data =  read_file($this->rootdir."paid/".$row->name.".".$row->filetype);
            $file_name = $row->name.".".$row->filetype;
        }
        force_download($file_name, $file_data);
    }

The problem comes up when CI loads the file as a string to force the download. I really don't want the file to be within the public's reach. Right now it sits under the html folder.


Messages In This Thread
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 12:07 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 12:26 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 12:31 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 02:14 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 02:18 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 02:25 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 02:36 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 02:43 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 02:50 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 03:03 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 03:11 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 03:15 AM
Using Download Helper With Extremely Large Files - by El Forum - 01-19-2008, 10:14 AM
Using Download Helper With Extremely Large Files - by El Forum - 12-09-2008, 05:08 AM
Using Download Helper With Extremely Large Files - by El Forum - 07-28-2011, 08:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB