Remove content-length header for download

Clean headers (if already output) before force_download
This commit is contained in:
jekkos-t520
2015-02-11 14:00:27 +01:00
parent 4a6a69bdef
commit 57cbbdab56
2 changed files with 4 additions and 5 deletions

View File

@@ -133,13 +133,14 @@ class Config extends Secure_area
{
$this->load->dbutil();
$prefs = array(
'format' => 'txt',
'format' => 'zip',
'filename' => 'ospos.sql'
);
$backup = $this->dbutil->backup($prefs);
$backup =& $this->dbutil->backup($prefs);
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.sql';
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip';
$save = 'uploads/'.$file_name;
$this->load->helper('download');
while (ob_get_level()) {
ob_end_clean();

View File

@@ -86,7 +86,6 @@ if ( ! function_exists('force_download'))
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Content-Transfer-Encoding: binary");
header('Pragma: public');
header("Content-Length: ".strlen($data));
}
else
{
@@ -95,7 +94,6 @@ if ( ! function_exists('force_download'))
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
header("Content-Length: ".strlen($data));
}
exit($data);
}