Also rewrite the logic a little, and try to make the code a little clearer.
Attach a file by drag & drop or click to upload