When merging this with 10.2 and later, one can just use the 10.2 or later code
Attach a file by drag & drop or click to upload