Don't access $_FILES directly, pass it as a parameter to the controller method.