Add the "complete" attribute, and set it in _session_callback(). _close() waits for it to become true.
Attach a file by drag & drop or click to upload