[eluser]jdav3579[/eluser]
Hi,
I have an internal application that allows the upload and download of zip files. The upload works as when I FTP into the folder and download it using filezilla it is fine, but when I use the following code:
function getfile($filename=null){
if($filename==null){redirect('welcome/download'); }
$string = read_file('./downloads/'.$filename);
force_download($filename, $filename);
}
When I save it on to the computer and try to open it, then I get an error message saying that the file is corrupt or invalid message.
Could it be something to do with headers or anything, or do I need to load a view etc? I have looked on the forums and came across something similar but the fix in the mimes,seemed to have no effect..
Does anyone know why this may be the case?
Also I think it has a problem getting images as well as Zips.
Cheers
John