Simplify the rather large function update_regular_file().
Attach a file by drag & drop or click to upload