Welcome Guest, Not a member yet? Register   Sign In
Need help using force_download...
#1

[eluser]BobbyB[/eluser]
Hi everybody,
I am having trouble using force_download.
I have following code:

Code:
//Controller:
function download(){

$id = $this->input->get_post('download', TRUE);

$this->load->model('get_freebies');

$data['freebies'] = $this->get_freebies->downloadselect($id);

}

//Model:
function downloadselect($id){

$query =  $this->db->get_where('freebies',array('freebiesid' => $id));

if( $query->num_rows() > 0 )

    {
       $row = $query->row();
       $name = $row->name;
       $data = file_get_contents(realpath('freebies_files/'.$name.'.jpg'));    
      
       force_download($name, $data);
    }      
}

I use an ajax-request to the controller using mootools(Request.HTML) which works fine when trying to delete files.

But the download does not Sad
Nothing happens at all.

Any hints?

Cheers&Thanks;


Messages In This Thread
Need help using force_download... - by El Forum - 11-26-2008, 03:06 PM
Need help using force_download... - by El Forum - 11-26-2008, 04:52 PM
Need help using force_download... - by El Forum - 11-26-2008, 05:51 PM
Need help using force_download... - by El Forum - 11-27-2008, 02:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB