Connect to http server / check if file exists [modified]
-
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
-
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 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
-
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 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
-
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