| | |
Streaming or downloading a text file from URL with C++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
0
#2 Oct 19th, 2009
•
•
•
•
Hello there,
What would be a simple way to stream a file from a url?
C++ Syntax (Toggle Plain Text)
#include <curl/curl.h> CURL *curl; CURLcode results; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se"); results = curl_easy_perform(curl); cout<<"results: "<<sizeof(results)<<" "<<results<<endl; /* always cleanup */ curl_easy_cleanup(curl); }
to include the right libs when linking type:
C++ Syntax (Toggle Plain Text)
$curl-config --libs -lcurl -lidn -llber -lldap -lrt -lgssapi_krb5 -lgssapi_krb5 -lz -lgnutls $
and it will display all the needed libs
![]() |
Similar Threads
- how to read content of html page and save in text file (C#)
- reading .txt file from URL (Java)
- Script to add url to text file (PHP)
- Code Snippet: delete a line from a text file (C++)
- read from database and writing the contents into a text file (C)
- # of lines in a text file (Java)
- help with updating a text file using C++ (C++)
- Help with comparing user input to a text file! (C++)
- Help Reading Info in Text File Into an Array (C++)
- Output in Text file-How to apply fprintf()? (C)
Other Threads in the C++ Forum
| Thread Tools | Search this Thread |
.htaccess ada api array based beginner binary bitmap bmp c# c++ change char char* cisco class client code compile compression console content download dwmapi encryption equation error file fstream function functions game google graph guess gui htaccess ifstream image input int internet java javascript kioti16 linux match math microsoft modal movie multiple news number office open opengl output performance pointer practice prime print problem program programming python read reading recursion recursive redirect registry review rpg rss save software sql staroffice stream string studio temperature template templates text torrent url validate variable video vista visual visualstudio web win32 windows write youtube






