File size: 2,255 Bytes
995d55d e075d72 995d55d 8ad5917 995d55d 8ad5917 995d55d 8ad5917 995d55d 8ad5917 e075d72 8ad5917 e075d72 8ad5917 e075d72 995d55d e075d72 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload JSON</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: #333;
}
form {
display: flex;
flex-direction: column;
}
label, input {
margin-bottom: 10px;
}
input[type="submit"] {
width: 150px;
padding: 10px;
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<h1>Upload JSON Data</h1>
<form id="json-upload-form" enctype="multipart/form-data" method="post" action="/j_upload_json">
<input type="file" name="file" accept=".json" id="json-file-input">
<br><br>
<label for="verify_phone">Verify Phone Number:</label>
<input type="checkbox" id="verify_phone" name="verify_phone" value="1">
<br>
<label for="add_curator">Add Curator:</label>
<input type="checkbox" id="add_curator" name="add_curator" value="1">
<br><br>
<input type="submit" value="Upload JSON">
</form>
<script>
document.getElementById('json-file-input').addEventListener('change', function(event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
console.log('JSON File Content:', e.target.result);
};
reader.readAsText(file);
}
});
document.getElementById('json-upload-form').addEventListener('submit', function(event) {
const file = document.getElementById('json-file-input').files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
console.log('JSON File Content on Submit:', e.target.result);
};
reader.readAsText(file);
}
});
</script>
</body>
</html>
|