The heuristics could probably be improved a lot, but this is better than nothing at least.
Attach a file by drag & drop or click to upload