Fix file upload forms

Work in progress on #512