I have a file in the local network. Is there any way I can access it in the ReactJS project that I run locally?

21 Views Asked by At

I have a file in a location in the local network which I am able to access in general. I could not access the file via my Reactjs project. I have mentioned what all I have tried below. Is there any way I can access it from the application?

I tried Craco but still couldn't access it. It says that it cannot resolve the path. I have it in the format "\192.XXX.X.XXX\Thanigahai\demo.docx".

When I tried to access via iframe using google url ->

I get "No Preview available error"

When I tried to access via iframe using microsoft url -> => I get "Microsoft refused to connect" I get this error for microsoft iframe url

When I tried the npm package @cyntler/react-doc-viewer I get "An error occurred". The Learn more link also does not contain anything and it returns 404.

Please help me with this I'm new to ReactJS

1

There are 1 best solutions below

2
David Bradshaw On

Have you tried file:///? Note the three / in that, as their is no host name.