Optimizations suggested and originally implemented by @oranagra. Re-applied by @antirez using the modified API.
Attach a file by drag & drop or click to upload