How can I use LANSA/Integrator FTPService to send a file to a Windows Server

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
PatrickF
Posts: 30
Joined: Thu Nov 26, 2015 1:31 pm

How can I use LANSA/Integrator FTPService to send a file to a Windows Server

Post by PatrickF »

Using LANSA V15 RDMLX installation on IBMi, using FTP Service to transfer a 40MB file to a Windows Server. The Windows Server is actually an Azure cloud running Windows 2019 DataCenter and the FTP Server bundled with IIS10. We control both ftp client and ftp server settings.
I can use ftp command entry to transfer the file successfully but the LANSA/Integrator RDMLX function doing the same steps fails.
The specific issue seems to be the SITE command listed here : https://docs.lansa.com/15/en/lansa093/i ... 7_1290.htm
By default on IBMi ftp, there is a SITE format for client and server. The client format defaults to 0 (meaning library format naming) . SITE NAMEFMT is not a command understood by a Windows Server, so I use LOCSITE NAMEFMT 1 in the ftp command entry to set the client NAMEFMT and avoid a Command Not understood error when I use NAMEFMT 1 which attempts to reset the Name Format for ftp client and ftp server.
I have 2 questions :
1) Should L/I have ignored the SITE command error and continued with the PUT. The L/I trace for PUT after the SITE Command returned an error seems to indicate that it didn't understand where to get the file from, perhaps because the SITE command didn't really work. I couldn't find a L/I FTPService command to check the NAMEFMT setting on FTP Client after running the SITE command
2) How to specify LOCSITE NAMEFMT 1 in the FTPService, which does not return an error when connecting to a Windows FTP Server because it only changes the FTP Client NAMEFMT
I have attached a zip with both logs. removing any customer identification information such as IP addresses and userids

My current workaround is to have LANSA RDXML call a CL driven Batch FTP Script where I manually set LOCSITE NAMEFMT 1 and the ftp works. but it's not ideal in passing in parameters to the script or reading the log programatically to verify that the ftp completed ok
Attachments
FTP to Windows Logs.zip
(1.95 KiB) Downloaded 1675 times
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: How can I use LANSA/Integrator FTPService to send a file to a Windows Server

Post by BrendanB »

Patrick,

perhaps try omitting the SITE command from your LI function.

Additionally, the put command seems incomplete:

PUT FROM(/LANSA_D15PGMLIB/tmp/) TO(ftptest.txt)

should probably be:

PUT FROM(/LANSA_D15PGMLIB/tmp/ftptest.txt) TO(ftptest.txt)

if you really feel you need the LOCSITE command (which is really issuing SITE on the IBMi), you could try:

QUOTE COMMAND("LOCSITE NAMEFMT 1")
QUOTE COMMAND("LCD /LANSA_D15PGMLIB/TMP")

Although i havent tested that.

LOCSITE: Use the LOCSIte subcommand to specify information that is used by the local host to provide services specific to that host system.

so really, it is not a command that you are sending to the REMOTE HOST, but the LOCALHOST... the QUOTE command can be used for that:

https://docs.lansa.com/15/en/lansa093/i ... 57C_____13

Even though the example specifically shows using the RCMD
Post Reply