Skip to main content
GameDev.net gamedev.net
🔒 Locked

online data

Started by CProgrammer Nov 9, 2004 at 3:25 PM 6 replies 1.2k views
Original Post
CProgrammer
CProgrammer
I can easily load a text file from the hard drive(fopen in C). Now how do I load a text file from a web url like http://www.somedomain.com/sometext.txt ? -CProgrammer
CProgrammer
CProgrammer
Thanks for the swift reply.
Well I already know some cgi programming but I dont want a server spplication. I want to make a noral windows application which uses the internet connection present to load the file.

-CProgrammer
Toolmaker
Toolmaker
That would require you to write a socket layer in your application. The layer needs to open a connection on port 80 to the webserver and post a HTTP GET request to get the file/page from the server.

Toolmaker
 
CProgrammer
CProgrammer
I see. Thanks. So Ill just check out windows sockets.

-CProgrammer
hplus0603
hplus0603
http-get is one of the smallest pieces of code I know of to get a URL "from scratch".

enum Bool { True, False, FileNotFound };
CProgrammer
CProgrammer
Wow, thats short for something like getting a file off the web?
Ok maybe some kind of free library? or can WinSock do this if so anyone have a tutorial?
Basically I want to be able to load any file in binary and text mode. Just like C File I/O.

-CProgrammer

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.