Question about this helper http://codeigniter.com/user_guide/helpers/download_helper.html
If, for example, program.exe weights 4 GB, will it take a lot of PHP memory for reading and delivering that file?
$data = file_get_contents("/path/to/program.exe"); // Read the file's contents
$name = 'software.exe';
force_download($name, $data);
force_downloadfunction just set the proper HTTP headers to make the client’s browser download the file. So, it won’t open the file, just pass it’s URL to the client.Check the helper source code, if you need: https://bitbucket.org/ellislab/codeigniter-reactor/src/31b5c1dcf2ed/system/helpers/download_helper.php
Edit: I’d sugest creating your own version of the helper, and, instead of using
strlento get the file size, use the php functionfilesize, which takes only the file name as argument and returns the size in bytes.More info, at http://www.php.net/manual/en/function.filesize.php