Use input-decode-map instead of function-key-map. Use event-modifiers now that it works reliably.
Attach a file by drag & drop or click to upload