adding file functionality to Controller