Good evening! I'm using the force_download()
function to download a file. However, I need to do the same procedure, but with several files downloaded at the same time. I implemented a code, the logic I used is not performing such a procedure. Can anyone give me a hint of what I can do?
Controller:
public function download($id = NULL){
$this->load->helper('download');
$download = $this->db->query('SELECT * FROM arquivos WHERE protocolo_id ='.$id);
foreach ($download->result() as $itens){
$diretorio = file_get_contents('./uploads/'.$itens->arquivo);
$arquivo = $itens->arquivo;
force_download($arquivo, $diretorio);
}
}