$maxSizeBytes) { return "File size exceeds the limit."; } // Read the file content $fileContent = file_get_contents($tmp); // Hash the file content using SHA-256 $hashedContent = hash('md5', $fileContent); // Generate a secure filename using the hashed content $secureFilename = $hashedContent . randomString(2) . '.' . $extension; return $secureFilename; }