Files download in FTP

General discussion regarding the development of POCO for contributors.
Posts: 7
Joined: 20 Oct 2008, 14:48

Files download in FTP

Postby AnithaSubramani » 22 Oct 2008, 11:57

Hi All,

Im new to Poco. I want to run the FTP download program. The sample code is

Code: Select all

#include "URIStreamOpener.h"
#include "StreamCopier.h"
#include "Path.h"
#include "URI.h"
#include "Exception.h"
#include "HTTPStreamFactory.h"
#include "FTPStreamFactory.h"

using Poco::URIStreamOpener;
using Poco::StreamCopier;
using Poco::Path;
using Poco::URI;
using Poco::Exception;
using Poco::Net::HTTPStreamFactory;
using Poco::Net::FTPStreamFactory;

int main(int argc, char** argv)
   std::cout<   std::cout<   if (argc != 2)
      Path p(argv[0]);
      std::cerr << "usage: " << p.getBaseName() << " " << std::endl;
      std::cerr << "       Download to standard output." << std::endl;
      std::cerr << "       Works with http, ftp and file URIs." << std::endl;
      return 1;

      URI uri(argv[1]);
      std::auto_ptr pStr(URIStreamOpener::defaultOpener().open(uri));
      StreamCopier::copyStream(*pStr.get(), std::cout);
   catch (Exception& exc)
      std::cerr << exc.displayText() << std::endl;
      return 1;
   return 0;

Im trying to run this code. The command is:

But it is showing the below exception:
FTP Exception: Login denied: 530 Not logged in, user account has been disabled

How to give the user name and password in command line.

Please help me...................................

Thanks & Regards,


Posts: 1375
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Files download in FTP

Postby alex » 22 Oct 2008, 14:38

> How to give the user name and password in command line.

Code: Select all


Posts: 3
Joined: 21 Oct 2008, 12:56

Re: Files download in FTP

Postby SeshaSridhar » 23 Oct 2008, 12:24

Hi Alex,
You had specified how to give username and password in commandline in the previous post.What does path here stand for?

Return to “Contributors”

Who is online

Users browsing this forum: No registered users and 1 guest