Set the xhr onprogress handlers when a function is provided