This my controller function in which i used database util library to crate backup for database. When i download a backup the zip file cannot be opened with zip extractor. What should I do?
function backup_database() {
$file_name = 'accounts';
$date = date('@Y.m.d-H.ia');
$name = $file_name . $date;
// Load the DB utility class
$this->load->dbutil();
// Backup entire database and assign it to a variable
$backup = & $this->dbutil->backup(array('filename' => "$name.sql"));
// Load the file helper and write the file to server
$this->load->helper('file');
write_file("$name.zip", $backup);
// Load the download helper and send the file to desktop
$this->load->helper('download');
force_download("$name.zip", $backup);
}