Question & Answer
Question
Sample FTP Gateway Service Session Scripts
Answer
Sample FTP Gateway Service Session Scripts
Use scripts to automate access to Sterling B2B CollaborationNetwork.This section contains a sample FTP session script. For a list of FTPcommands see Summaryof FTP Client Commands.
Open a connection to the FTP gateway service:
ftp> open ftp.gts.globalec.com220 Connected.
Submit login information:
User (primary.gts.globalec.com:(none)): SX999001331 Password required.Password: *******230 User SX999001 logged in proceed.
Upload outgoingEDI file:
ftp> cd send250 CWD command successful.ftp> put outbound.txt200 PORT command successful.150 Opening ASCII mode data connection for outbound.txt.150 Opening data connection.ftp: 1655 bytes sent in 0.00Seconds 655000.00Kbytes/sec.
Verifythat the file was successfully transmitted:
ftp> ls200 PORT command successful.150 Opening ASCII mode data connection.outbound.txtcommit226 Transfer complete.ftp: 625 bytes sent in 0.00Seconds 55000.00Kbytes/sec.
Movethe outgoing file to the commit directory:
ftp> ren "/send/outbound.txt" "/send/commit/outbound.txt"350 File exists ready for destination name250 RNTO command successful.
Verify that the file wassuccessfully moved:
ftp> ls200 PORT command successful.150 Opening ASCII mode data connectioncommit226 Transfer complete.ftp: 57 bytes sent in 0.00Seconds 5000.00Kbytes/sec.
Changeto mailbox containing inbound EDI data:
ftp> cd /receive250 cwd Directory changed. Current working mailbox is ?/receive.?
Viewavailable EDI files:
ftp> ls200 PORT command successful.150 Opening data connection.322322850902129928169054322329310601390029614837226 Transfer complete. 1625 Bytes sent.
Turn off interactivemode. No prompt will be given between each file:
ftp> promptInteractive mode Off.
Download files:
ftp> mget *200 Command okay.200 PORT command successful.150 Opening ASCII mode data connection for 322320403202120028094870.226 Transfer complete.ftp: 307 bytes sent in 0.28Seconds 2.11Kbytes/sec.200 PORT command successful.150 Opening ASCII mode data connection for 322321047302120028112985.226 Transfer complete.ftp: 1625 bytes sent in 0.33Seconds 1.79Kbytes/sec.
Verifythat all available files have been downloaded:
ftp> ls200 PORT command successful.150 Opening ASCII mode data connection.226 Transfer complete.
Sign off:
ftp> bye221 Goodbye.
Was this topic helpful?
Document Information
Modified date:
08 December 2018
UID
ibm10758207