• Advertisement

Archived

This topic is now archived and is closed to further replies.

anybody know any nice networking classes - ftp, http file access?

This topic is 5491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello. was wondering if anybody knew of any nice c++ classes/functions that would let me do something like this: for http: downloadfile(char *url, char *fname); and it would in an ideal world work like this download("http://www.blahblah.com/pics/goldfish.jpg","fishy.jpg"); this ideal function would grab that file and save it in the applications folder called ''fishy.jpg'' does such a set of functions exist for c/c++?

Share this post


Link to post
Share on other sites
Advertisement
If you used *unix, like linux you could embed a system call into your program that would execute "wget" to retrieve the file you wanted.

RandomTask

Share this post


Link to post
Share on other sites
You use winsock, connect to the host, and learn the HTTP 1.1 protocol (hint: listen on port 80 on your local machine and point IE at it then save what IE sends).

All the functions exist. You just have to know how to put them together.

Ben


IcarusIndie.com [ The Labyrinth | DevZone | Indie Mail | Hosting | Tiberian Merchandise | GameShot | Fun With Cutouts ]

Share this post


Link to post
Share on other sites
I wrote a sockets wrapper class that can do simple downloads of webpages - see the first code example on this page:
http://www.zppz.com/libraries/minisock/about/index.jsp
With some small modifications to the demo program, it would be able to save files, you''ll probably need to know a little more HTTP to do it properly though.

----------
http://www.zppz.com <- game dev stuff

Share this post


Link to post
Share on other sites
quote:
Original post by kindfluffysteve
does such a set of functions exist for c/c++?

URLDownloadToFile does that.

Share this post


Link to post
Share on other sites
I got one better:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/about_wininet.asp

Much better than rolling your own, but won''t be cross-platform.

Interim.

Share this post


Link to post
Share on other sites

  • Advertisement