file repository upload controller refactor