'~' ? '.' : $c; } $out .= sprintf("%08x: %-40s %-16s\n", $ctr, $hex_string, $ascii_string); $ctr += 16; } return $out; } $message = ''; // Is there an upload? if (isset($_FILES['file-upload'])) { $upload_dir = 'uploads/' . bin2hex(random_bytes(8)); $upload_path = $upload_dir . '/' . basename($_FILES['file-upload']['name']); mkdir($upload_dir); $upload_contents = xxd(file_get_contents($_FILES['file-upload']['tmp_name'])); if (file_put_contents($upload_path, $upload_contents)) { $message = 'Your file has been uploaded. Click here to view'; } else { $message = 'File upload failed.'; } } ?>
Our patented hex technology™ allows you to view the binary data of any file. Try it here!
= $message ? '' . $message . '
' : ''; ?>