Sign in to follow this  
CProgrammer

online data

Recommended Posts

CProgrammer    303
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Well, you could do it in C via CGI if you want. Search for CGI programming with C or C++. OR, you could use Python, PHP, Perl, JSP, ASP.. etc etc.


Since you already now C, using CGI is probably the easiest route to take (assuming your server supports CGI). Opening a file via C using CGI is the same as opening a file with just C.


Share this post


Link to post
Share on other sites
CProgrammer    303
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

Share this post


Link to post
Share on other sites
Toolmaker    967
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

Share this post


Link to post
Share on other sites
CProgrammer    303
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this