[eluser]Daniel H[/eluser]
Is anybody aware of any problems with memory limits using read_file or force_download?
My (summarised) code is this:
Code:
// Get the file contents
$data = read_file("./static/brief/$brief->zip_filename.zip"); // Read the file's contents
$name = "ycn-0809-$brief->url_title.zip";
// If the download failed go back to awards section
if (!force_download($name, $data))
redirect('awards');
This works absolutely perfectly with all the zip files that are less than 8mb, however one is 8.3mb and it downloads as 4kb and Safari says 'decompression failed' once it has done so.
I added this line at the top of the download function:
Code:
ini_set("memory_limit","18M");
...yet this doesn't seem to have any effect. Any ideas?
Thanks,
Dan.