Add attach_file_and_redirect helper

This new helper can be used when the UI submits
the form in the 'onchange' event of the file input