Search code examples
phpcodeigniterforce-download

Codeigniter force_download Internal Server Error


I’m hosting website on VPS, PHP 5.3 Installed

I’m having problem with force_download method

$this->load->helper('download');
$data = file_get_contents('stuff'.$result->file_full_path);
$name = $result->file_name.' - Website.com.'.$result->file_extension;
force_download($name, $data); 

this is my code

Some files worked perfectly fine but large files ( more than 10mb or 50mb) shows internal server error :(

Please tell me where can i set / change file size limit if possible


Solution

  • Probably your php memory_limit setting.

    http://www.php.net/manual/en/ini.core.php#ini.memory-limit

    You can find similar question with answer here: 500 error when downloading files over 63MB

    Try to update your PHP.ini setting and increase your memory limit.