NP-2629: refactored file upload to handle ActionDispatch interface