944,141 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4917
  • C++ RSS
Oct 19th, 2009
1

Streaming or downloading a text file from URL with C++

Expand Post »
Hello there,
What would be a simple way to stream a file from a url?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
madmaze is offline Offline
2 posts
since Oct 2009
Oct 19th, 2009
0
Re: Streaming or downloading a text file from URL with C++
Click to Expand / Collapse  Quote originally posted by madmaze ...
Hello there,
What would be a simple way to stream a file from a url?
I figured it out.. Im using libcURL\

C++ Syntax (Toggle Plain Text)
  1. #include <curl/curl.h>
  2.  
  3. CURL *curl;
  4. CURLcode results;
  5.  
  6. curl = curl_easy_init();
  7. if(curl) {
  8. curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
  9. results = curl_easy_perform(curl);
  10. cout<<"results: "<<sizeof(results)<<" "<<results<<endl;
  11. /* always cleanup */
  12. curl_easy_cleanup(curl);
  13. }

to include the right libs when linking type:
C++ Syntax (Toggle Plain Text)
  1. $curl-config --libs
  2. -lcurl -lidn -llber -lldap -lrt -lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls
  3. $

and it will display all the needed libs
Reputation Points: 10
Solved Threads: 0
Newbie Poster
madmaze is offline Offline
2 posts
since Oct 2009
Dec 14th, 2009
0
Re: Streaming or downloading a text file from URL with C++
Hey,

I read your post about using the curl library. Can you help me figure out what you meant when you wrote,

Click to Expand / Collapse  Quote originally posted by madmaze ...
to include the right libs when linking type:
C++ Syntax (Toggle Plain Text)
  1. $curl-config --libs
  2. -lcurl -lidn -llber -lldap -lrt -lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls
  3. $

and it will display all the needed libs
I am using VC++ 6.0 in XP. I am hoping to use the curl library to open 100000 http pages and save the results. Any help is appreciated.
Reputation Points: 10
Solved Threads: 0
Light Poster
TylerTCF is offline Offline
26 posts
since Mar 2008
Sep 21st, 2010
0
Re: Streaming or downloading a text file from URL with C++
Hi,
if there is a free solution, can someone put up a zip with the needed libs and a working example to do over modifies? Would be a great help to us!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ralphc++ is offline Offline
1 posts
since Sep 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: SQL/Access Database connectivity with VC++.net
Next Thread in C++ Forum Timeline: C++ help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC