Sponsored Links
Sponsored Link

sponsored links

Collapse

Announcement

Collapse
No announcement yet.

FTPS batch mode

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTPS batch mode

    I have been doing this for a long time and it works without any problems (unless the network is having issues). That is, uploading files from either my PC or a network folder. I use the -s switch which points to a text file that contains FTP subcommands. The company is planning to migrate to FTPS, so I have to connect using port 990. Easy if I am connecting from IBMi to IBMi, but in this situation I need to connect from the PC or network drive.

    My system administrator told me it is not possible.
    Is that true? If not, what is the syntax I need to open a secure port?

    I am executing this from within my CL program.
    ftp -n -s:t:\mis\sltools\scripts\MYSYSTEM\getftpfile.txt

    This is what is in getftpfile.txt located on the network drive:
    open MYSYSTEM
    user MYUSER mypassword
    PUT t:\mis\sltools\files\d2d3_02-15-17\LAS_30161.csv MYLIBRARY/MYWORKFILE
    close
    quit



  • #2
    Personally, I do not use FTP over SSL ("FTPS" or "FTPES"), I don't think it is well designed, etc, it has major problems with firewalls and NAT. But... what you're asking to do should be possible.

    Microsoft does not support SSL in the Windows-provided "FTP.EXE" file that appears to be what you're using in your script... at least, I guess that's what you're using? However, it should be possible to find/install a different FTP client for Windows that does support SSL. A quick Google found this article that lists a bunch of alternatives, though I haven't tried any:
    http://geekswithblogs.net/bvamsi/arc.../23/73147.aspx

    I guess the advantage of using old-style FTP like this is that IBM added features (these are nonstandard and do not exist on other systems) that allow you to upload to a database table (physical file) and automatically translate to EBCDIC while transferring. I suspect one of the above FTP commands would provide that as well, since you'd still be using the IBM FTP server for i.

    If you want to go a bit more mainstream, you could consider replacing FTP with SFTP or SCP from the SSH toolset. This is a better designed network protocol (imho) and is more secure. For the really simple stuff you're doing in this example, SCP would be a one-liner, you wouldn't even need a script. You wouldn't be able to send to a physical file, but it looks like your PF is just a work file anyway, so you'd want to adjust your process to upload to the IFS, and then use CPYFRMIMPF or CPYFRMSTMF, etc to convert it to a PF. Shouldn't be hard. That's the direction I'd take.

    Comment

    sponsored links

    Collapse

    Working...
    X