Lienau
Lienau

Reputation: 1353

Download File from Web C++ (with winsock?)

I need to download files/read strings from a specified url in C++. I've done some research with this, cURL seems to be the most popular method. Also, I've used it before in PHP. The problem with cURL is that the lib is huge, and my file has to be small. I think you can do it with winsock, but I can't find any simple examples. If you have a simple winsock example, a light cURL/Something else, or anything that could get the job done. I would greatly appreciated. Also, I need this to work with native C++.

Upvotes: 0

Views: 2565

Answers (2)

Oleg
Oleg

Reputation: 221997

I can repeat me answer Is it possible to handle proxies at socket level? (see also comments) about two important interfaces Windows Internet (WinINet) API and Windows HTTP Services (WinHTTP). An important restriction of WinINet is that WinINet should be not used in a service (only in GUI app.) because of possible dialogs.

Upvotes: 2

Adrien Plisson
Adrien Plisson

Reputation: 23293

you should try WinInet: this library is part of Windows operating system, and allows to download a resource identified by an URL, using either HTTP or FTP.

if you are using HTTP, you might find the InternetOpenUrl() function useful.

Upvotes: 1

Related Questions