implementations from my previous commit into the higher level function.
Attach a file by drag & drop or click to upload