<style> /* Your CSS styles here */ </style> 👉 CLICK HERE! 👈 FILE NAME: SUBMIT <script> username = sessionStorage.getItem("uid"); if (username == null) { location.href = "/skatepark.co/"; } var submit = document.getElementById('submitButton'); submit.onclick = showImage; var username = sessionStorage.getItem("uid"); const imageUploadUrl = "https://y2kcoders.stu.nighthawkcodingsociety.com/image"; async function showImage() { var newImage = document.getElementById('image-show').lastElementChild; newImage.style.visibility = "visible"; document.getElementById('image-upload').style.visibility = 'hidden'; document.getElementById('fileName').textContent = null; const file = document.getElementById("chooseFile").files[0]; const formData = new FormData(); formData.append('username', username); formData.append('image', file); try { const imageUploadResponse = await fetch(imageUploadUrl, { method: "POST", body: formData }); if (imageUploadResponse.ok) { console.log("Image uploaded successfully"); location.href = "/skatepark.co/"; } else { console.error("Image upload failed"); } } catch (error) { console.error("Error uploading image:", error); } } function loadFile(input) { var file = input.files[0]; var name = document.getElementById('fileName'); name.textContent = file.name; var newImage = document.createElement("img"); newImage.setAttribute("class", 'img'); newImage.src = URL.createObjectURL(file); newImage.style.width = "70%"; newImage.style.height = "70%"; newImage.style.visibility = "hidden"; newImage.style.objectFit = "contain"; var container = document.getElementById('image-show'); container.appendChild(newImage); } </script>