SSH FTP and Uniface

Author: mweaver68@gmail.com (Mike Weaver)

I have been tasked with trying to find a solution for SSH FTP in Uniface. Can this be done and if so, what is the syntax for it?

Thanks for any suggestions.

M Weaver

5 Comments

  1. Hi Michael,

    AFAIK, a couple of FTP transports in uniface are based on some 3rd party FTP software (sometimes even with commandline interface).

    Another option may be to use UHTTP to construct a request (according to Theo on the next reply, this may not be feasable).


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. I tried to construct an FTP component with UHTTP last year but could not get it to work. If I remember correctly the problem was the protocol. (ftp:// instead of http://) If somebody has a (semi-)working example I would be very interested.


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  3.  

    I guess I should have stated how we currently FTP (unsecure since password is transmitted as plain text) to the FTP server:
    $NEW_ARCH$ = "%%$FTP_FILENAME$%%%_%%$TMP_DATE$%%%.txt"
    $FTP_SCRIPT$ = "user XXX PASSWORD%\
       %%^cd ifta%\
       %%^put C:\FILEPATH\%%$FTP_FILENAME$%%%.txt taxreturn_in.txt%\
       %%^put C:\FILEPATH\%%$FTP_FILENAME$%%%.txt archive/%%$NEW_ARCH$%%%%\
       %%^bye%%^"
      
    $FTP_COMMAND$ = "ftp -n -d -s:C:\FILEPATH\ftp_script_%%$FTP_FILENAME$%%% 172.XX.XXX.XX > C:\FILEPATH\error_log_ftp_%%$FTP_FILENAME$%%%.txt%%^"
      
    file_dump $FTP_SCRIPT$, "C:\FILEPATH\ftp_script_%%$FTP_FILENAME$%%%"
    file_dump $FTP_COMMAND$, "C:\FILEPATH\ftp_%%$FTP_FILENAME$%%%.cmd"
      
    spawn "#C:\FILEPATH\ftp_%%$FTP_FILENAME$%%%.cmd"
    if( $status < 0 )
          message/error "Errors during FTP Process. $status = %%$status%%% ."
          message/error "procerror: %%$procerror%%% %%^ procerrorcontext: %%$procerrorcontext%%% ."
          message/error "dataerrorcontext: %%$dataerrorcontext%%% ."
    endif
     
     
    What would need to be done to this code so that it would be SFTP? I know there is some configuration that needs to be done to the server for authentication purposes but not sure about the code.

    Author: Mike Weaver (mweaver68@gmail.com)
  4. Hi Michael,

    you may have a loook at:

    http://www.coreftp.com/

    and

    http://cc.byexamples.com/2007/10/07/libcurl-httpftpsshtelnetldap-client-api/

    both have FTP and SSh in their descriptions

     

    one is an external tool, the other can be included in your own DLL so you can use it straight with the uniface activate.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  5. Hi,

    As you already know there's no native support in Uniface for Secure FTP. What I did for our company was to build a .NET Class component that will contain functionality to send and receive files through secure FTP. Then I exposed this component through COM which Uniface supports.

    If you are willing to go this path, this is the Company Website that provides .NET components that support Secure FTP.

    http://www.atp-inc.net/

     


    Author: danieto (alejandron@afsi.com)