login/edit: move upload handling code into include