From 49a0a4e12706ae850d671a709603a7e8ffc3a22c Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Tue, 10 Feb 2015 11:00:09 +0100 Subject: [PATCH] download backpus as plain sql file --- application/controllers/config.php | 9 ++------- system/helpers/download_helper.php | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/application/controllers/config.php b/application/controllers/config.php index 92bff75b1..1592ac931 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -133,18 +133,13 @@ class Config extends Secure_area { $this->load->dbutil(); $prefs = array( - 'format' => 'gzip', + 'format' => 'txt', 'filename' => 'ospos.sql' ); $backup = $this->dbutil->backup($prefs); - $file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.gz'; - $save = 'uploads/'.$file_name; - - $this->load->helper('file'); - write_file($save, $backup); - + $file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.sql'; $this->load->helper('download'); force_download($file_name, $backup); } diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 85749aa97..16ee4e9cd 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -97,7 +97,6 @@ if ( ! function_exists('force_download')) header('Pragma: no-cache'); header("Content-Length: ".strlen($data)); } - ob_clean(); exit($data); } }