Showing results for 
Search instead for 
Did you mean: 

Read File in LabVIEW NXG Web VI

Go to solution

I have a web VI (gviweb) in LabVIEW NXG.  I have a couple settings that I would like the web VI to be able to read from a text file.  I would include this text file in the same folder as the built web server folder.  Is this possible in an NXG web VI?

0 Kudos
Message 1 of 4

Hello pulidotech,


I believe there's not a native function to do that yet. I presume you could try using Javascript to perform this operation, see: NXG : How to read/upload a file in a webVI ?


All the best,

0 Kudos
Message 2 of 4
Accepted by pulidotech

Hi pulidotech,


If the text file is included in the same folder as the built WebVI and is served with your application, you can use the HTTP GET VIs to retrieve the file contents.


For example, the following shows a text file named myfile.txt that is included as part of a Web Application component. When built the myfile.txt ends up in the build output folder. When the build output is served and loaded in a Web Browser, the WebVI uses HTTP GET to fetch the contents of the file. In this case myfile.txt contains the string "hello world".





Message 3 of 4
Message 4 of 4