HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/myapi/postTestEsc.php
<?php
// Get the JSON data sent from the client
$json = file_get_contents('php://input');

// Decode JSON to PHP array
$data = json_decode($json, true);

// Process the data
if ($data !== null) {
    // Access the JSON values
	$dStr = $data['prex'];
    $patch1 = $data['patch1'];  // json_decode already unescapes \n, \t, \" sequences

$myFile ="../FograCT1/upload/".$dStr;                  
$fvcc = fopen($myFile, 'w') or die("can't open file");
fwrite($fvcc, $patch1);
fclose($fvcc);

    echo json_encode(array('message' => 'Data received and processed successfully'));
} else {
    echo json_encode(array('message' => 'Invalid JSON data'));
}
?>