Drag & Drop File Upload Playground

Mr. Tono’s tray: a real drop zone, real drag events, and a FormData the simulated village office reads. What happens when one preventDefault is forgotten? An…

Why it matters

Drag-and-drop upload is everywhere: avatars, attachments, CSV imports. The API is small but full of traps: without preventDefault() in dragover the feature is dead and the browser opens the file, the zone’s highlight flickers over child elements, files vanish after an await, and a hand-written Content-Type leaves the server unable to read the upload.

The key idea

A drop zone prevents twice, and its contents exist only during the event

Common mistakes

Try it in this playground