HISE Logo Forum
    • Categories
    • Register
    • Login

    Check if file exists on server

    Scheduled Pinned Locked Moved Scripting
    4 Posts 3 Posters 106 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tomekslesicki
      last edited by tomekslesicki

      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!

      d.healeyD A 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @tomekslesicki
        last edited by

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

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • A
          aaronventure @tomekslesicki
          last edited by

          @tomekslesicki check out the example for Server.callWithPOST in the docs.

          1 Reply Last reply Reply Quote 0
          • T
            tomekslesicki
            last edited by

            Thanks so much, that's very helpful, I appreciate it!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            26

            Online

            1.7k

            Users

            11.7k

            Topics

            102.0k

            Posts