Changed sendfile to be controlled by parameters