# \[vtkjs\] Get download progress with vtkXMLPolyDataReader.setUrl?

**URL:** https://discourse.vtk.org/t/vtkjs-get-download-progress-with-vtkxmlpolydatareader-seturl/4518
**Category:** Web
**Created:** [October 29, 2020, 10:26am UTC](https://discourse.vtk.org/t/vtkjs-get-download-progress-with-vtkxmlpolydatareader-seturl/4518 "2020-10-29T10:26:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nicoco](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/7c8e57/32.png) [@nicoco](https://discourse.vtk.org/u/nicoco)
#### Post date: [October 29, 2020, 10:26am UTC](https://discourse.vtk.org/t/vtkjs-get-download-progress-with-vtkxmlpolydatareader-seturl/4518/1 "2020-10-29T10:26:19Z")

</div>

Is there any way to get the download progress, ideally as a percentage, when using `vtkXMLPolyDataReader.setUrl`? Since the dataset my app downloads is relatively large, I would like to display this information to the user.

My code looks like:

```auto
const reader = vtkXMLPolyDataReader.newInstance();
const promise = reader.setUrl(this.vtpURI).then(() => {
  // set up actor, mapper, …
}

```

My javascript knowledge is quite basic, but I guess the download progress can be accessed somewhere in this `promise` thing, right? Any suggestion is welcome.

```auto

```

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [October 29, 2020, 2:32pm UTC](https://discourse.vtk.org/t/vtkjs-get-download-progress-with-vtkxmlpolydatareader-seturl/4518/2 "2020-10-29T14:32:40Z")

</div>

You can monitor [progress via a callback](https://github.com/Kitware/vtk-js/blob/d99471f2007e9d2059b499c01e9cc1cbdca294d1/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper.js#L23-L25) using an optional argument on the [setURL](https://github.com/Kitware/vtk-js/blob/master/Sources/IO/XML/XMLReader/index.js#L336) method.

---

<div class="post-metadata">

### Author: ![nicoco](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/7c8e57/32.png) [@nicoco](https://discourse.vtk.org/u/nicoco)
#### Post date: [October 30, 2020, 7:26am UTC](https://discourse.vtk.org/t/vtkjs-get-download-progress-with-vtkxmlpolydatareader-seturl/4518/3 "2020-10-30T07:26:19Z")

</div>

Thanks! Exactly what I needed.
