and dialog init. Make a few internal function static and share a few others.
Attach a file by drag & drop or click to upload