Fix some things about controller
implement file upload