[eluser]coffak[/eluser]
Hi to all,
I'm doing an application that needs to download files from the server, and I'm using the download helper. Here is the function I call to download the files:
Code:
public function downloadFiles($file_name)
{
$this->load->helper('download');
$data = file_get_contents(base_url()."uploads/".$file_name.".jpg");
force_download($nombre_archivo."_anexo.jpg", $data);
}
The problem is that the file is downloaded but I can't open it, Picassa (or any other image editor) gives me the error "Invalid Image". Also google chrome gives me this warning when the file is downloaded:
Resource interpreted as Document but transferred with MIME type "image/jpeg".
I have searched in google , and it seems that has something to do with the headers, but I don't have a clue.. So, thanks in advance for any help
Regards