Spaces:
Sleeping
Sleeping
Create static/creator.js
Browse files12345678910111213141516171819202122document.getElementById("uploadForm").addEventListener("submit", async (e) => { e.preventDefault(); const fileInput = document.getElementById("fileInput"); if (!fileInput.files.length) { alert("Please select a file first."); return; }
const formData = new FormData(); formData.append("file", fileInput.files[0]);
const res = await fetch("/api/upload", { method: "POST", body: formData });
const data = await res.json(); document.getElementById("status").innerText = data.status === "success" ? `✅ Uploaded ${data.filename}` : `❌ Error: ${data.error}`;});static/creator.jsAdded+22