Network Programming: Downloading a File from the Internet

Hey everyone,

I know this question can be seen a lot around on this site, but I think mine is a little different in terms of what I'm looking for. First off, I'm a total (n00b + id10t) and don't know anything really about all this. My end goal is to download a file from the internet (e.g. an .EXE or .DAT file) and save it locally to the machine running the program. Right now, I'm just asking a question and not looking for code, lol, so don't think I'm here asking you guys to do my work for me. The environment that this program will run on will be Windows.

With my end goal in mind my question is this: What solution can I implement that will WORK OUT THE BOX (as in immediately) without a client having to download anything extra onto their machine and is PORTABLE across both 32-bit and 64-bit Windows?

By that I mean, as developers, we get all these tools and resources downloaded to our machines whenever we install an IDE, like say Visual Studio, that grants us access to all the necessities to make things work. I want to make this program run on a normal user's machine without them having to install these said tools that comes to us developers. Some initial digging led me to find that I can either use a couple of different things on Windows (winsock.h, wininet.h, afxinet.h). Which one of these (or other solutions) are already built into the OS and do not require a download of additional resources?

(Hopefully this all made sense...)
Last edited on
With my end goal in mind my question is this: What solution can I implement that will WORK OUT THE BOX (as in immediately) without a client having to download anything extra onto their machine and is PORTABLE across both 32-bit and 64-bit Windows?

1) I'm sure it could be done with standard Windows files, but it would be tough. You have to deal with things such as encryption on your own, which would be tricky and not recommended. I say find an SSL library and use that, and just link statically.
2) It would be much easier to just build a 32 bit app, and worry about released a 64 bit version at a later date. A 32 bit app should work just fine on 64 bit windows.
Thanks Biscuit for that input.

What APIs would be the best and work out of the box on bare bone Windows client machines? WinSock? WinINet? MFC? Other?
AFAIK, WinSock should come installed already as Microsoft apps are going to use it.
winsock , wininet (this is what internet explorer uses), winhttp comes preinstalled on all windows versions (at least on modern ones, like xp or higher).
Topic archived. No new replies allowed.