document.getElementById('inp').onchange = async (e) => { const file = e.target.files[0]; if (!file) return; const status = document.getElementById('status'); status.innerText = "⏳ HD Processing..."; try { const response = await fetch('APNA_WORKER_URL_YAHAN', { method: 'POST', // FormData ki bajaye direct file object bhej rahe hain body: file }); if (!response.ok) throw new Error("AI Processing Failed"); const blob = await response.blob(); const url = URL.createObjectURL(blob); document.getElementById('res').src = url; document.getElementById('res').style.display = "block"; status.innerText = "✅ Success!"; } catch (err) { status.innerText = "❌ Error: " + err.message; } };