Split uploadFileHandler up a little