ob_start(); $path = "../../../../"; require_once $path . "defaultIncludes.php"; require_once $path . "inc.serverPath.php"; $SESSION_UID = $_SESSION["SESSION_UID"]; $localizationInput = array("db" => $db, "db_type" => $db_type, "user_ids" => array($SESSION_UID)); $localization = localization_get_by_user($localizationInput); if ($include_file == 1) { $data_str = $data_str_include; $file_name = $file_name_include; $file_type = $file_type_include; $file_name_in_header = $file_name_in_header_include; $encode = 0; } else { $data_str = isset($_POST["data_str"]) ? $_POST["data_str"] : ''; $file_name = isset($_POST["file_name"]) ? $_POST["file_name"] : "vdv_data"; $file_type = isset($_POST["file_type"]) ? $_POST["file_type"] : "txt"; $header_included = isset($_POST["header_included"]) ? $_POST["header_included"] : 0; $customEncoding = isset($_POST["customEncoding"]) ? $_POST["customEncoding"] : "UTF-8"; $encode = isset($_POST["encode"]) ? $_POST["encode"] : 0; } $customFileName = isset($_POST["custom_file_name"]) ? $_POST["custom_file_name"] : ''; if ($data_str != '') { if ($encode == 0) { echo ""; } if ($header_included == 0) { $saveas = $file_name . "_" . date("YmdHis") . . $file_type; if ($file_name_in_header == 1) { echo $saveas . "\xd\xa"; } echo "Data was saved using Vista Data Vision\xd
"; echo "Saved: " . date($localization["php_date_format"] . " H:i:s") . "\xd\xa
"; } else { $saveas = $file_name . . $file_type; } if ($customFileName != '') { $saveas = $customFileName . $file_type; } if ($encode == 1) { $data_str = iconv(mb_detect_encoding($data_str), $customEncoding, $data_str); } echo "{$data_str}"; $buffer = ob_get_contents(); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check, pre-check=0"); header("Cache-Control: private", false); header("Content-Transfer-Encoding: binary"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Length: " . strlen($buffer)); header("Content-Disposition: attachment; filename="" . $saveas . """); echo $buffer; }
© 2023 Quttera Ltd. All rights reserved.