Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Connect to http server / check if file exists [modified]

Connect to http server / check if file exists [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminlinux
4 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    ALLERSLIT
    wrote on last edited by
    #1

    Hello, id like to connect to a http server, preferably in a multiplatfrom working way so the code will work on linux and windows, a windows only way is fine for now aswell i guess (c/c++ only). After the connection is established i want to check if a file exists. Open for any function recommendations /papers etc. Just anything. Thanks.

    modified on Wednesday, June 30, 2010 11:49 AM

    D M A 3 Replies Last reply
    0
    • A ALLERSLIT

      Hello, id like to connect to a http server, preferably in a multiplatfrom working way so the code will work on linux and windows, a windows only way is fine for now aswell i guess (c/c++ only). After the connection is established i want to check if a file exists. Open for any function recommendations /papers etc. Just anything. Thanks.

      modified on Wednesday, June 30, 2010 11:49 AM

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      A non-portable way might be to use URLDownloadToFile(). You might also check the socket API.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Man who follows car will be exhausted." - Confucius

      1 Reply Last reply
      0
      • A ALLERSLIT

        Hello, id like to connect to a http server, preferably in a multiplatfrom working way so the code will work on linux and windows, a windows only way is fine for now aswell i guess (c/c++ only). After the connection is established i want to check if a file exists. Open for any function recommendations /papers etc. Just anything. Thanks.

        modified on Wednesday, June 30, 2010 11:49 AM

        M Offline
        M Offline
        Moak
        wrote on last edited by
        #3

        A portable solution would be using one of the many C++ networking libraries offering a "HTTP client". Checking if a file exists is as simple as making a HTTP request and see if something else than status code 200 is returned, strictly speaking 404 means file not found. /M

        Chat in Europe :java: Now with 24% more Twitter

        1 Reply Last reply
        0
        • A ALLERSLIT

          Hello, id like to connect to a http server, preferably in a multiplatfrom working way so the code will work on linux and windows, a windows only way is fine for now aswell i guess (c/c++ only). After the connection is established i want to check if a file exists. Open for any function recommendations /papers etc. Just anything. Thanks.

          modified on Wednesday, June 30, 2010 11:49 AM

          A Offline
          A Offline
          Aescleal
          wrote on last edited by
          #4

          I'd suggest cURL http://curl.haxx.se/[^], or rather the libcurl bit of it. Works on Windows, Linux, FreeBSD, OS/X and Solaris and those are just the platforms I've used it on. Cheers, Ash

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups