Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    How to download a file in R20+

    Cinema 4D SDK
    maxon api r21 s22 r23
    2
    5
    547
    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.
    • fwilleke80F
      fwilleke80
      last edited by fwilleke80

      Hi,

      How would I go about downloading a (text) file from a webserver? Ideally, this should be done in a separate thread, so the GUI isn’t blocked while waiting for the server response?

      I just want to read what’s in the file, it doesn’t need to be stored locally.

      I know, using a separate Python plugin it is very easy, but I’d prefer doing it in C++. If it's possible in R20 - R23, even better.

      Thanks in advance & greetings,
      Frank

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by Manuel

        hi,

        you should have a look at this thread from which, we've updated the documentation.

        Using the function ReadFileToMemory you can read the stream to an array and you can use ConvertTextToLines. to have a per-line result

        ReadFileToMemory is present since R20 but i didn't tried there.

        Let me know if it's working, otherwise I will have a look if i find something better.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • fwilleke80F
          fwilleke80
          last edited by

          Hi Manuel,

          thanks, that looks exactly like the thing I need!
          Was only looking into NetworkHttpHandlerInterface the whole time...

          I'll try this out soon and then report back.
          Will set this thread to solved, as my question was answered 🙂

          Thanks & greetings,
          Frank

          www.frankwilleke.de
          Only asking personal code questions here.

          1 Reply Last reply Reply Quote 0
          • fwilleke80F
            fwilleke80
            last edited by

            It's working perfectly, thanks again!
            So much easier than I thought 🙂

            Cheers,
            Frank

            www.frankwilleke.de
            Only asking personal code questions here.

            1 Reply Last reply Reply Quote 0
            • ManuelM
              Manuel
              last edited by

              hi,

              by the way, i forgot to talk about the thread thing.

              This thread might help
              And of course our manuals about threading

              Cheers
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

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