# Serve data to vtk.js frontend

**URL:** https://discourse.vtk.org/t/serve-data-to-vtk-js-frontend/6563
**Category:** Web
**Created:** [September 6, 2021, 4:25pm UTC](https://discourse.vtk.org/t/serve-data-to-vtk-js-frontend/6563 "2021-09-06T16:25:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jordvink](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jordvink](https://discourse.vtk.org/u/jordvink)
#### Post date: [September 6, 2021, 4:25pm UTC](https://discourse.vtk.org/t/serve-data-to-vtk-js-frontend/6563/1 "2021-09-06T16:25:07Z")

</div>

Hi all,

I’m trying to figure out the best way to serve a user’s .vtp file to a vtk.js frontend. I am creating a Django application in which different users can view their own data in vtk.js. I have been looking at the vtk.js examples, but all the examples use static references to the data. What would be the best way to pass the location of the user’s data to the vtk.js frontend?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [September 7, 2021, 2:35pm UTC](https://discourse.vtk.org/t/serve-data-to-vtk-js-frontend/6563/2 "2021-09-07T14:35:53Z")

</div>

You can either use `vtkHttpDataSetReader` ([here is an example](https://github.com/Kitware/vtk-js/blob/master/Examples/Volume/VolumeContour/index.js#L44-L49)), or you can use `fetch`/`XMLHttpRequest` to download your dataset and use the `vtkXMLPolyDataReader` to read in your vtp file.

---

<div class="post-metadata">

### Author: ![jordvink](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jordvink](https://discourse.vtk.org/u/jordvink)
#### Post date: [September 8, 2021, 9:23am UTC](https://discourse.vtk.org/t/serve-data-to-vtk-js-frontend/6563/3 "2021-09-08T09:23:16Z")

</div>

Hi Forrest,

Thanks a lot!
