Use find-file-hook and write-file-functions instead of find-file-hooks and write-file-hooks.
Attach a file by drag & drop or click to upload