Make sure the endHandler is correclty notified when the upload is streamed to disk