# How to read external VTK file in React project

**URL:** https://discourse.vtk.org/t/how-to-read-external-vtk-file-in-react-project/12381
**Category:** Web
**Created:** [September 28, 2023, 8:02am UTC](https://discourse.vtk.org/t/how-to-read-external-vtk-file-in-react-project/12381 "2023-09-28T08:02:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![stoune](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/eb8c5e/32.png) [@stoune](https://discourse.vtk.org/u/stoune)
#### Post date: [September 28, 2023, 8:02am UTC](https://discourse.vtk.org/t/how-to-read-external-vtk-file-in-react-project/12381/1 "2023-09-28T08:02:41Z")

</div>

Hi,

In VTK.js with React to read a VTK file we call this function to read a VTK file, we call this function with the directory of the VTK file (that must be in the public folder tree structure).

```auto
const reader1 = vtkPolyDataReader.newInstance();
reader1
       .setUrl(`resources/MrSKIN.vtk`)
       .then(async () => {
            pd = await reader1.getOutputData(0);

```

I need to read a VTK file from other “system directory”:

```auto
reader1
       .setUrl(`C:/Users/admin/data/MrSkin.vtk`)

```

But that doesn’t work, I’ve read that I must re-configure the webpack file but I don’t know how to exactly do it

---

<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: [October 2, 2023, 2:48pm UTC](https://discourse.vtk.org/t/how-to-read-external-vtk-file-in-react-project/12381/2 "2023-10-02T14:48:58Z")

</div>

You can’t read from the filesystem like that unfortunately. You have to use a static file proxy server to be able to read files off of disk, or else manually open it via `<input type=file>`.
