IMHO, it's generally good style to register the callbacks first.
Attach a file by drag & drop or click to upload