Read and write a txt file


#1

1) Give a description of the problem
Is there a way to read and write a LOCAL text file (Windows 10 desktop) with webcore? I have searched for some information all morning, but cannot find an answer or examples. I would like to avoid using Google Sheets.
2) What is the expected behaviour?
I want to read a local text file (playlist file), manipulate the data, and write the file back out locally.


#2

Just a quick thought of the top of my head…

Could you serve the file up through the inbuild IIS web server on windows? You could then just call the URL and receive the data. To write data would be more complicated though as you’d need an app on the web server to accept and write the data.


#3

This does not work…


#4

You’ll need to configure the IIS service, this includes the base path for the file e.g c:\myfiles If you then place your file in that directory, you should be able to see it using 192.168.0.31/test.txt

Test your IIS service first via a browser. I’m afraid I can’t remember of the top of my head how to configure IIS, I did mine a few years ago. But there should be plenty of details on line.


#5

Once you have setup IIS, the default file location is C:\inetpub\wwwroot. Saving your test file in that folder would require the GET request to go to http://192.168.0.31/Test.txt

I just tested a file saved in json format and was able to successfully parse the file using $response.


#6

Did you check this out yet? @E_Sch been busy ;D


#7

Yes!! I saw that today. Whoop…Whoop!