create(filename_decode($gedname), PCLZIP_OPT_COMMENT, $comment, PCLZIP_OPT_REMOVE_PATH, filename_decode($temppath)); if ($v_list == 0) echo "Error : " . $archive->errorInfo(true); else { unlink(filename_decode($gedname)); if ($removeTempDir) rmdir(filename_decode($temppath)); header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH."downloadbackup.php?fname=".$zipname); exit; } exit; } if ($action == "download") { header('Content-Type: text/plain; charset=UTF-8'); // We could open "php://compress.zlib" to create a .gz file or "php://compress.bzip2" to create a .bz2 file $gedout = fopen('php://output', 'w'); if (strtolower(substr($ged, -4, 4))!='.ged') { $ged.='.ged'; } header('Content-Disposition: attachment; filename="'.$ged.'"'); export_gedcom($GEDCOM, $gedout, $exportOptions); fclose($gedout); exit; } print_header(WT_I18N::translate('Download GEDCOM')); ?>