How to load data from a FTP server


#1

Hi,
I try to download a file from an FTP server and it fails. What’s wrong with this code ?

int main (int argc, char* argv[])
{

URL url("ftp://ftp.uconn.edu/48_hour/check-network");
MemoryBlock buffer;
if (url.readEntireBinaryStream(buffer)) {
	std::cout << buffer.getSize() << " bytes read" << std::endl;
}
else {
	std::cout << "Failed to read " << url.toString(true) << std::endl;
}
return 0;

}