diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index fd3b474c718..8cec13a8311 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -512,8 +512,8 @@ print $langs->trans("Compression").':   '; $compression=array( 'none' => array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")), // 'zip' => array('function' => 'zip_open', 'id' => 'radio_compression_zip', 'label' => $langs->trans("Zip")), Not open source - 'gz' => array('function' => 'gz_open', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")), - 'bz' => array('function' => 'bz_open', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2")) + 'gz' => array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")), + 'bz' => array('function' => 'bzopen', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2")) ); foreach($compression as $key => $val) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index b621ef35feb..bc602073f77 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -115,6 +115,9 @@ if ($what == 'mysql') $param.=" -d"; } $relativepathfile='/admin/temp/'.$file; + // for compression format, we add extension + if ($compression == 'gz') $relativepathfile.='.gz'; + if ($compression == 'bz') $relativepathfile.='.bz2'; $relativepatherr=$relativepathfile.'.err'; $outputfile=DOL_DATA_ROOT.$relativepathfile; $outputerror=DOL_DATA_ROOT.$relativepatherr; @@ -149,8 +152,7 @@ if ($what == 'mysql') if ($compression == 'none') $handle = fopen($outputfile, 'r'); if ($compression == 'gz') $handle = gzopen($outputfile, 'r'); if ($compression == 'bz') $handle = bzopen($outputfile, 'r'); - $handle = fopen($outputfile, "r"); - $errormsg = fgets($handle); + $errormsg = fgets($handle,10); if ($compression == 'none') fclose($handle); if ($compression == 'gz') gzclose($handle); if ($compression == 'bz') bzclose($handle);