| | |
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 |
.net api array binary bitmap bmp borland c# c++ calling char char* class code codeblocks compression console cron decide delete development directshow download ebook encryption error file floatingpoint fstream function functions game gnu google graph htaccess html ifstream image input int internet java job keyboard linker linux math maze mediawiki michaelmoore microsoft movie music news numbers office open output p2p parallel partnership passing php pong problem proficiency program programming python read reading recursion recursive redirect registry remote snakes software stop store stream string subclass system template text text-file toolbar toolkit tree tutorial url video vista visual web win32 windows write






