|]@u', '_', $_POST['filename']) : 'saved').'.svg'; // These characters are indicated as prohibited by Windows $fh = fopen($filename, 'w') or die("Can't open file"); fwrite($fh, $svg); fclose($fh);