How to read external VTK file in React project

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).

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”:

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

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>.