The two functions are identical, no point in duplicating code here.
Attach a file by drag & drop or click to upload