The former is in Ruby's core lib, so is more flexible.
Attach a file by drag & drop or click to upload