locked
FTP to SFTP RRS feed

  • Question

  • I need to change my code to go from FTP to SFTP in Visual C++.  Does the CFTPConnecton class have this capability?  Or is there another class?  Thanks in advance.

    Monday, January 11, 2010 7:36 PM

Answers

  • SFTP can mean many different things. Visit http://en.wikipedia.org/wiki/SFTP to get some idea about things called SFTP and clarify when you post your next question. 

    MFC is not part of the C++ language, so a better place for MFC question is the VC General forum, which covers VC libraries. The C++ language forum does not cover everything you can do in the C++ language--otherwise it would overlap with all other .Net and Windows SDK forums. 

    However, MFC's CFTPConnection class is just an API wrapper over WinInet, so a better place for this particular question would be the microsoft.public.inetsdk.programming.wininet newsgroup.

    You can also search "SFTP" in open source communities and check if any of them is using MFC as well.


    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    • Marked as answer by Wesley Yao Friday, January 15, 2010 3:26 AM
    Tuesday, January 12, 2010 1:03 AM
  • Secure FTP has never been standardized. Therefore there is nothing built into MFC to help you write a Secure FTP client; every SFTP server is going to behave a little differently.

    So the answer is, you can certainly write an SFTP client yourself in Visual C++ 2005, but you will have to implement the protocol yourself.
    • Marked as answer by Wesley Yao Friday, January 15, 2010 3:26 AM
    Tuesday, January 12, 2010 5:09 PM

All replies

  • SFTP can mean many different things. Visit http://en.wikipedia.org/wiki/SFTP to get some idea about things called SFTP and clarify when you post your next question. 

    MFC is not part of the C++ language, so a better place for MFC question is the VC General forum, which covers VC libraries. The C++ language forum does not cover everything you can do in the C++ language--otherwise it would overlap with all other .Net and Windows SDK forums. 

    However, MFC's CFTPConnection class is just an API wrapper over WinInet, so a better place for this particular question would be the microsoft.public.inetsdk.programming.wininet newsgroup.

    You can also search "SFTP" in open source communities and check if any of them is using MFC as well.


    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    • Marked as answer by Wesley Yao Friday, January 15, 2010 3:26 AM
    Tuesday, January 12, 2010 1:03 AM
  • Sorry, I'll try to be clearer.  I presently have a program in Visual C++ 2005 that use CFTPConnection to do FTP transfers.  I want to know is it possible to do Secure FTP  (SFTP) using Visual C++ in the same manner or is it possible at all.  Thanks in Advance.

    Present Code looks like this:

    CFtpConnection* ftp = mySession.GetFtpConnection(server,username,passwd,nPort,NULL);

    success = ftp->PutFile(htmlFile,remoteFile);

     

    Tuesday, January 12, 2010 3:01 PM
  • Secure FTP has never been standardized. Therefore there is nothing built into MFC to help you write a Secure FTP client; every SFTP server is going to behave a little differently.

    So the answer is, you can certainly write an SFTP client yourself in Visual C++ 2005, but you will have to implement the protocol yourself.
    • Marked as answer by Wesley Yao Friday, January 15, 2010 3:26 AM
    Tuesday, January 12, 2010 5:09 PM
  • Ok Thanks, but I'm using Visual C++ or MFC C++.
    Wednesday, March 17, 2010 12:35 PM
  • Thanks
    • Proposed as answer by Matin Bobis Sunday, May 2, 2010 12:51 AM
    Friday, March 19, 2010 10:12 AM
  • I need to change my code to go from FTP to SFTP in Visual C++.  Does the CFTPConnecton class have this capability?  Or is there another class?  Thanks in advance.

    I do not know you are mentioning about MFC C++ or C++ Managed. If Managed C++, you may need a library. It can either be free or commercial:

    Free:

    - Sharp SSH

    Commercial:

    - Ultimate FTP and Ultimate SFTP

    - Eldos

    - Rebex FTP

    • Edited by Clark MCPD Saturday, August 18, 2012 10:42 AM update links
    Tuesday, May 25, 2010 1:31 AM
  • Why waste our time with this non-answer?
    • Proposed as answer by johnyzsu Thursday, June 5, 2014 3:19 AM
    Thursday, January 26, 2012 3:39 PM