Spaces:
Runtime error
Runtime error
Download static/creator.js from low-key-007/chat-bot-api-2: direct link, hf CLI and curl.
- Browser
- Download file 616 Bytes
-
https://huggingface.co/spaces/low-key-007/chat-bot-api-2/resolve/main/static/creator.js
- Command line
-
hf download hf://spaces/low-key-007/chat-bot-api-2/static/creator.js
-
curl -L -o creator.js https://huggingface.co/spaces/low-key-007/chat-bot-api-2/resolve/main/static/creator.js
616 Bytes
| document.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}`; | |
| }); | |