<!DOCTYPE html>
<html>
<head>
  <title>Corrupt Uploaded File</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
  <meta name="description" content="Easily corrupt any file that the user can upload, corrupt a file">
  <script src="https://cdn.counter.dev/script.js" data-id="d5378282-a7bf-4de1-b215-693a25f3b961" data-utcoffset="2"></script>
  <link rel="icon" type="image/x-icon" href="/images/cted.jpg">
</head>
<body>
<div class="container">
  <h1>Upload and Corrupt File</h1>
  <input type="file" id="fileInput">
  <button onclick="corruptFile()">Corrupt File</button>
  
  <script>
function corruptFile() {
const fileInput = document.getElementById("fileInput");
const file = fileInput.files[0];
const reader = new FileReader();
reader.onload = function(event) {
 const data = new Uint8Array(event.target.result);
 for (let i = 0; i < data.length; i++) {
 data[i] = 0xff + Math.floor(Math.random() * 256);
 }
 const blob = new Blob([data], {type: file.type});
 const downloadLink = document.createElement("a");
 downloadLink.href = URL.createObjectURL(blob);
 downloadLink.download = "corrupted_" + file.name;
 downloadLink.click();
};
reader.readAsArrayBuffer(file);
fileInput.value = "";
}
  </script>

</body>

<style>
     body {
      font-family: Arial, sans-serif;
      background-color: #f2f2f2;
      color: #333;
    }
    h1 {
      font-size: 72px;
      font-weight: bold;
      margin: 100px 0 60px;
      text-align: center;
    }
    input[type="file"] {
      display: block;
      margin: 0 auto 60px;
      padding: 20px;
      border: none;
      border-radius: 10px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      background-color: #fff;
      color: #333;
    }
    button {
      display: block;
      margin: 0 auto;
      padding: 20px 40px;
      border: none;
      border-radius: 10px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      background-color: #2196f3;
      color: #fff;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }
    button:hover {
      background-color: #1976d2;
    }

  </style>
</html>