Overview
Features
Download
Documentation
Community
Add-Ons & Services

FTP login

A general discussion forum.

FTP login

Postby SeshaSridhar » 29 Oct 2008, 12:10

Hi All,

We are trying to login to a remote pc using ftp.We are building in c++.I tried out the example provided as download in POCO

Code: Select all

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


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)
{
   HTTPStreamFactory::registerFactory();
   FTPStreamFactory::registerFactory();
   
   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;
   }

   try
   {
      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;
}


Am getting the below output listed in exception.if i run download program
usage: ftpdownload <uri>
Download <uri> to standard output.
Works with http, ftp and file URIs.

if i run ftpdownload ftp:sam:sam@/THebrain.com then i get
Timeout

Please help me or provide some link.
Thanking you in anticipation,
SeshaSridhar
SeshaSridhar
 
Posts: 3
Joined: 21 Oct 2008, 12:56

Re: FTP login

Postby SeshaSridhar » 29 Oct 2008, 12:30

While running the program am getting the following error also
E:New Folderoct29debug>oct29 ftp://sam:sam@122.134.67.67
FTP Exception: RETR command failed: 501 Syntax error

Please help
SeshaSridhar
 
Posts: 3
Joined: 21 Oct 2008, 12:56

Re: FTP login

Postby alex » 29 Oct 2008, 14:28

> Please help me or provide some link.

http://pocoproject.org/poco/wiki/tiki-view_forum_thread.php?comments_parentId=1243&topics_offset=1&forumId=2

http://www.google.com

And last (but not least):

http://www.catb.org/~esr/faqs/smart-questions.html#before
alex
 
Posts: 1158
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron