This simplifies and clarifies the code, and gives a small speedup.
Attach a file by drag & drop or click to upload