Check if file exists on server
-
I'm sure it's something simple, but I'm just figuring out the Server calls and stuff. I'd like to write a function that works like this:
1) Create a file name based on a var I defined in the script - let's say it's HISE_IS_AWESOME.txt 2) Make a call to the server to see if a file with such a filename exists - the path is mydomain.com/files/HISE_IS_AWESOME.txt 3) If the file exists, do something
How should I approach this?
Thank you!
-
@tomekslesicki You can use cURL for this, you'll need to run as a terminal command from within HISE - I haven't tried but I think @aaronventure is doing this.
If you want to do it with pure HISE you can try a get request, but I think this will download the file, in which case downloading the file might be simpler.
If you have are able to setup rest endpoints to call php functions on your server you could do the check on the server side and report the result to HISE using a get request.
-
@tomekslesicki check out the example for Server.callWithPOST in the docs.
-
Thanks so much, that's very helpful, I appreciate it!