Hello,
I am trying to use OpenSession method as described in Automating tasks with OLE Automation scripts section of the help document. I have create a simple session with this code to download a file from Mainframe with ASCII transfer type
Set myFtpApp = CreateObject("FTPSFtp.Application")
myFtpApp.DefaultSessionFolder = "C:\\FTPSession\\"
myFtpApp.TransferType = "ASCII"
Set myFtpSession = myFtpApp.NewSession
myFtpSession.Hostname = "Mainframe"
myFtpSession.UserName = "Mainframe Username"
myFtpSession.Password = "Mainframe Password"
myFtpSession.TransferType = "ASCII"
rc = myFtpSession.SaveSessionFileAs("testSession.sft")
myFtpApp.CloseAllSessions
myFtpApp.Quit
When I try to use this newly created session file, all works except the file is downloaded with binary transfer type. In the session file that gets created by the code above I can see that the Transfer Type is set to ASCII
Here is the code I use to get file from Mainframe using session file
Set myFtpApp = CreateObject("FTPSFtp.Application")
myFtpApp.DefaultSessionFolder = "C:\\FTPSession\\"
Set myFtpSession = myFtpApp.OpenSession("testSession.sft")
rc = myFtpSession.ReceiveFile("'Path to file(FileName)'", "C:\\FTP\\")
myFtpApp.CloseAllSessions
myFtpApp.Quit
What am I missing here?
Pawel
#question
#Rumba